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

Allows both dashes or underscores for v8flag word separator. #8

Closed
wants to merge 2 commits into from

Conversation

sttk
Copy link
Contributor

@sttk sttk commented Dec 10, 2017

In Node.js API document, there is a description that:

Note: V8 options allow words to be separated by both dashes (-) or underscores (_).
For example, --stack-trace-limit is equivalent to --stack_trace_limit.

This pr is for supporting this.

sttk added a commit to sttk/flagged-respawn that referenced this pull request Dec 10, 2017
@sttk sttk force-pushed the v8flags-allow-dashes-or-underscores branch from 2e79265 to 25bc4d0 Compare December 10, 2017 13:35
@sttk sttk mentioned this pull request Dec 10, 2017
@sttk sttk force-pushed the v8flags-allow-dashes-or-underscores branch from 25bc4d0 to 6f1b8f0 Compare December 10, 2017 15:03
@phated
Copy link
Member

phated commented Dec 11, 2017

@sttk has node supported this since 0.10 or maybe it only supported underscores?

@tkellen is this something we want to support?

@sttk
Copy link
Contributor Author

sttk commented Dec 12, 2017

@phated Yes. v0.10 supports this specification. Following is the result I tried:

$ cat test.js
const s = 'hello';
console.log(s);
$ node -v
v0.10.48
$ node test.js
hello
$ node --use_strict test.js

/Users/sttk/test.js:1
(function (exports, require, module, __filename, __dirname) { const s = 'hello
                                                              ^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:945:3
$ node --use-strict test.js

/Users/sttk/test.js:1
(function (exports, require, module, __filename, __dirname) { const s = 'hello
                                                              ^^^^^
SyntaxError: Use of const in strict mode.
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:945:3
$ # Execute with unsupported flag
$ node --use--strict test.js
Error: unrecognized flag --use--strict
Try --help for options
hello
$

@phated
Copy link
Member

phated commented Dec 13, 2017

@sttk any idea why this is failing?

@sttk
Copy link
Contributor Author

sttk commented Dec 14, 2017

The reason of failing in this and other PRs is only timeout. In my travis test, those tests succeeded.

This timeout is caused in the same test case and it is the first test case using child_process.exec.
Since It simply executes ./test/bin/respawner.js which is used other test cases, I think that first child_process.exec spent a lot of time.

We may need to set timeout longer for this test case or on the whole.

@phated
Copy link
Member

phated commented Dec 16, 2017

Cherry-picked as c787fb1

@phated phated closed this Dec 16, 2017
@sttk sttk deleted the v8flags-allow-dashes-or-underscores branch December 17, 2017 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants