Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running lab with coverage on babel compiled code #355

Closed
corbinu opened this issue May 12, 2015 · 4 comments
Closed

Error when running lab with coverage on babel compiled code #355

corbinu opened this issue May 12, 2015 · 4 comments
Assignees
Labels
bug
Milestone

Comments

@corbinu
Copy link
Contributor

@corbinu corbinu commented May 12, 2015

So I have a bit of code compiled with babel and not sure if this is a lab or babel issue so will cross link issues. Lab runs fine with out coverage but get this error with coverage enabled:

./dist/test/couchbase/doc.js',5);continue _function;
                                                                    ^^^^^^^^^
SyntaxError: Undefined label '_function'
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:414:25)
    at Object.require.extensions.(anonymous function) [as .js] (./node_modules/lab/lib/coverage.js:29:36)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at ./node_modules/lab/lib/cli.js:105:23
    at Array.forEach (native)
    at Object.internals.traverse (./node_modules/lab/lib/cli.js:101:19)
    at Object.exports.run (./node_modules/lab/lib/cli.js:50:29)
    at Object.<anonymous> (./node_modules/lab/bin/lab:3:23)
    at Module._compile (module.js:431:26)
    at Object.Module._extensions..js (module.js:449:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Function.Module.runMain (module.js:472:10)
    at startup (node.js:124:18)
    at node.js:959:3

Here is the compiled source

var _get = function get(_x2, _x3, _x4) { var _again = true; _function: while (_again) { desc = parent = getter = undefined; _again = false; var object = _x2,
    property = _x3,
    receiver = _x4; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x2 = parent; _x3 = property; _x4 = receiver; _again = true; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } };
@corbinu

This comment has been minimized.

Copy link
Contributor Author

@corbinu corbinu commented May 12, 2015

@corbinu

This comment has been minimized.

Copy link
Contributor Author

@corbinu corbinu commented May 12, 2015

According to @sebmck this is a lack of loop label support

Marsup added a commit to Marsup/lab that referenced this issue May 12, 2015
@Marsup

This comment has been minimized.

Copy link
Member

@Marsup Marsup commented May 12, 2015

Fixed in my branch, waiting on @geek to merge #354 to PR. (to avoid conflicts)

@geek geek added the bug label May 12, 2015
@geek geek added this to the 5.8.1 milestone May 12, 2015
@geek geek self-assigned this May 12, 2015
Marsup added a commit to Marsup/lab that referenced this issue May 12, 2015
@geek geek closed this May 12, 2015
geek added a commit that referenced this issue May 12, 2015
Fix coverage on loop labels. Fixes #355.
@corbinu

This comment has been minimized.

Copy link
Contributor Author

@corbinu corbinu commented May 12, 2015

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.