es6-for-of
Compiles JavaScript written using ES6 for-of to ES3 syntax. For example, this:
for var a of b console;
compiles to this:
var { var sym = typeof Symbol === "function" ? Symboliterator : "@@iterator"; if typeof iterablesym === "function" return iterablesym; else if ObjectprototypetoString === "[object Array]" return ; else throw ; }; var { var index = 0; return { if index >= arraylength return done: true value: void 0 ; else return done: false value: arrayindex++ ; } ;}; for var $__0 = $__1; !$__1 = $__0nextdone; var a = $__1value; console;
Install
$ npm install es6-for-of
Browserify
Browserify support is built in.
$ npm install es6-for-of # install local dependency
$ browserify -t es6-for-of $file
Setup
First, install the development dependencies:
$ npm install
Then, try running the tests:
$ npm test