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

--use_strong produces SyntaxError at the node wrapper level #4197

Closed
gajus opened this issue Dec 8, 2015 · 4 comments
Closed

--use_strong produces SyntaxError at the node wrapper level #4197

gajus opened this issue Dec 8, 2015 · 4 comments
Labels
invalid Issues and PRs that are invalid.

Comments

@gajus
Copy link

gajus commented Dec 8, 2015

curiosity:test gajus$ echo 'let test;' | node --use_strong
node.js:14
    var EventEmitter = NativeModule.require('events');
    ^^^

SyntaxError: In strong mode, 'var' is deprecated, use 'let' or 'const' instead

Given that node supports let in strict mode, this should be already possible.

@ChALkeR
Copy link
Member

ChALkeR commented Dec 8, 2015

Node.js does not support running under an enforced strong mode, that's a v8 flag.
Also, you should not be enforcing strict/strong and whatever else modes with global flags. Use use strict or use strong per file or function instead, or else you are going to terribly break various modules expectations.

@ChALkeR ChALkeR closed this as completed Dec 8, 2015
@ChALkeR ChALkeR added the invalid Issues and PRs that are invalid. label Dec 8, 2015
@bnoordhuis
Copy link
Member

I'm fairly sure we can't support --use_strong even if we wanted to. Some of the restrictions are highly incompatible with the current code base and would probably trick down into user code.

@gajus Consider using --strong_mode and 'use strong' to opt-in to strong mode on a per-function / per-module basis.

@gajus
Copy link
Author

gajus commented Dec 8, 2015

Wouldn't it make sense to remove the flag from the command line interface?

There is no reason to expose and option that is not working.

@bnoordhuis
Copy link
Member

It's a V8 flag and we have a policy of not touching those. If you're using them, it's assumed you know what you're doing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Issues and PRs that are invalid.
Projects
None yet
Development

No branches or pull requests

3 participants