神刀安全网

JSClassFinder: Detecting class-like structures in legacy JavaScript code

JSClassFinder

Detecting class-like structures in legacy JavaScript code (prior to ECMAScript 6).

Installation

JSClassFinder is implemented in Pharo (a Smalltalk-like language)

You can download a ready-to-use Pharo image here , or use the instructions below to install JSClassFinder inside your own Pharo image:

1 – Open Monticello browser

2 – Add a new repository (+Repository) of type HTTP

3 – Fill in the required information as below

MCHttpRepository      location: 'http://smalltalkhub.com/mc/LeonardoHumberto/JSClasses/main'      user: ''      password: '' 

4 – Choose the newest release

Input

JSClassFinder expects the AST of a JS source code, in JSON format, as input.

To generate the AST we use Esprima .

Use the instructions below to use Esprima under Node.js :

1- install Node.js

2- load Esprima package : “npm install esprima”

3- Ok, you are ready to execute Esprima commands.

The file analyse.js is one example of script that can be used to generate JSON files.

More Info

Leonardo Silva, Miguel Ramos, Marco Tulio Valente, Nicolas Anquetil, Alexandre Bergel. Does Javascript Software Embrace Classes? In 22nd International Conference on Software Analysis, Evolution and Reengineering (SANER) , pages 1-10, 2015. Paper , Slides

Download

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » JSClassFinder: Detecting class-like structures in legacy JavaScript code

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮