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

Strict mode error in npm-crawl.js #1307

Open
bmomberger-bitovi opened this issue Nov 20, 2017 · 4 comments
Open

Strict mode error in npm-crawl.js #1307

bmomberger-bitovi opened this issue Nov 20, 2017 · 4 comments
Labels

Comments

@bmomberger-bitovi
Copy link
Contributor

The line https://github.com/stealjs/steal/blob/master/ext/npm-crawl.js#L332 declares an auto-global variable v in a for...in loop. This breaks in strict mode, as v is not a previously defined name. This line should be for(var v in versions) {

@matthewp
Copy link
Member

Thanks, this is clearly a bug, but did you see this happening some where? This file isn't strict mode so I wouldn't think that would occur, no?

@matthewp matthewp added the bug label Nov 20, 2017
@bmomberger-bitovi
Copy link
Contributor Author

TIL that strict mode gets injected into files when using the --coverage flag in testee. A naive coverage configuration (which doesn't ignore anything by default) will inject strict into everything including steal's files.

A better issue title would state that npm-crawl places v on the global namespace.

@matthewp
Copy link
Member

Oh, that's interesting. Possible testee bug I would think? cc @andrejewski There might be code (not this one) that needs to run in sloppy mode, but maybe there's a good reason for testee to do this?

@matthewp
Copy link
Member

Also cc-ing @m-mujica on any ideas why our linting didn't catch this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants