首页> 外文会议>International Conference on Software Reuse >Refactoring Legacy JavaScript Code to Use Classes: The Good, The Bad and The Ugly
【24h】

Refactoring Legacy JavaScript Code to Use Classes: The Good, The Bad and The Ugly

机译:重构遗留javascript代码要使用类:好的,坏和丑陋

获取原文

摘要

JavaScript systems are becoming increasingly complex and large. To tackle the challenges involved in implementing these systems, the language is evolving to include several constructions for programming-in-the-large. For example, although the language is prototype-based, the latest JavaScript standard, named ECMAScript 6 (ES6), provides native support for implementing classes. Even though most modern web browsers support ES6, only a very few applications use the class syntax. In this paper, we analyze the process of migrating structures that emulate classes in legacy JavaScript code to adopt the new syntax for classes introduced by ES6. We apply a set of migration rules on eight legacy JavaScript systems. In our study, we document: (a) cases that are straightforward to migrate (the good parts); (b) cases that require manual and ad-hoc migration (the bad parts); and (c) cases that cannot be migrated due to limitations and restrictions of ES6 (the ugly parts). Six out of eight systems (75%) contain instances of bad and/or ugly cases. We also collect the perceptions of JavaScript developers about migrating their code to use the new syntax for classes.
机译:JavaScript系统变得越来越复杂和大。为了解决实现这些系统所涉及的挑战,语言正在不断发展,包括用于in-in--in-ligh的多个结构。例如,虽然语言是基于原型的,但最新的JavaScript标准名为ECMAScript 6(ES6),为实现类提供了本机支持。尽管大多数现代Web浏览器支持ES6,但只有很少的应用程序使用类语法。在本文中,我们分析了迁移结构的过程,该结构模拟了传统JavaScript代码中的类,以采用ES6引入的类的新语法。我们在八个遗留JavaScript系统上应用一组迁移规则。在我们的研究中,我们文件:(a)迁移的案件(良好的部分); (b)需要手动和ad-hoc迁移的案件(不良部分); (c)由于ES6(丑陋部分)的限制和限制而无法迁移的案件。八个系统中的六个(75%)包含糟糕和/或丑陋情况的情况。我们还收集JavaScript开发人员关于迁移其代码以使用类别的新语法的看法。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号