gotwarlost / istanbul

Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests and browser tests. Built for scale.
Other
8.7k stars 788 forks source link

ECMAScript 6 support #141

Open cctuan opened 10 years ago

cctuan commented 10 years ago

Hi, is it possible to have a version that support harmony version?

We have problem when the scripts contains "let" and "const" ..etc. which are from ECMA 6.

I saw there's a harmony branch in istanbul, but unfortunately, it cannot work in our FirefoxOS test env which does not support to download repo from "git://xxx".

It will be nice if this plugin could provide a version without git dependency

gotwarlost commented 10 years ago

Why don't you just download the instrumenter from: https://raw2.github.com/gotwarlost/istanbul/harmony/lib/instrumenter.js

And similarly for esprima and escodegen that are required for the browser.

https://raw2.github.com/ariya/esprima/harmony/esprima.js

I cannot publish a new module just for this.

cctuan commented 10 years ago

@gotwarlost Thanks, I create another repo with the new instrumenter.js and use git://github.com/ariya/esprima.git#harmony for esprima. However, the mocha test always tell me |SyntaxError: Use of const in strict mode.| error.

Is there any other options I haven't enable yet?

gotwarlost commented 10 years ago

Could you give me a reproducible test case so I can dig into what is happening?

jonathanong commented 10 years ago

@gotwarlost is there a possibility you could unpin the esprima dep so i could just do npm i ariya/esprima#harmony and have it work? right now i'm using https://www.npmjs.org/package/istanbul-harmony which is kind of silly

andrewdeandrade commented 9 years ago

@gotwarlost So like 12 hours ago esprima 2.0.0 was released, which is the first version with official ES6 support. Would it be possible to upgrade istanbul to esprima 2 and start supporting the es6 features it currently supports (there are only 3 features so far).

silkentrance commented 6 years ago

@gotwarlost it seems that this had been resolved. Can we please close this?