-
Notifications
You must be signed in to change notification settings - Fork 240
4.0 beta
JSDuck 4.0 beta is now out and brings with it a new JavaScript parser.
Using Esprima.js internally, JSDuck 4 has much improved auto-detection capabilities.
/** My panel */
Ext.define("MyPanel", {
extend: "Ext.panel.Panel",
config: {
/**
* Title for the panel
*/
title: "Untitled"
},
inheritableStatics: {
/**
* Registers the panel globally.
* @param {MyPanel} panel
*/
register: function(panel) {
}
},
floating: false
});
From the above code JSDuck 4 detects config option title
, static method register
and private property floating
. In JSDuck 3 you would have needed to explicitly use @cfg + @accessor tags for the config option, @static + @inheritable tag for static method, and the private property would have needed a doc-comment with @private tag.
To install 4.0 beta, run:
$ gem install jsduck --pre
Additionally you should install therubyracer gem which provides a fast v8 bridge for running esprima.js:
$ gem install therubyracer
In Windows there are two options:
Download the jsduck-4.0.beta.exe binary. It should work out of the box, but it will be terribly slow as it's using the Windows JScript host by default. To speed things up install NodeJS (make sure you also add node executable to your PATH). It will still be slower than JSDuck 3, but at least the speed should be bearable.
First off, install JRuby. Then download the jsduck-4.0.jrubybeta.gem and install:
> jruby -S gem install path\to\jsduck-4.0.jrubybeta.gem
This will install jsduck and all its dependencies. Now you can run it like this:
> jruby -S jsduck --version
Or if you only have the JRuby version of JSDuck installed, simply this should work:
> jsduck --version
Check out the esprima-parser
branch:
$ cd jsduck
$ git checkout esprima-parser
Clone my fork of esprima.js into a subdir and check out linenr-in-range
branch:
$ git clone git://github.com/nene/esprima.git
$ cd esprima
$ git checkout linenr-in-range
Ensure unit tests are passing:
$ cd ..
$ rake
Have fun :)