-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
src: whitelist v8 options with '_' or '-' #14093
src: whitelist v8 options with '_' or '-' #14093
Conversation
c30731d
to
46d25fe
Compare
Is it worth the extra code? Maybe just give a better error then: C:\Users\refael>set NODE_OPTIONS=--abort-on_uncaught-exception
C:\Users\refael>node
node: --abort-on_uncaught-exception is not allowed in NODE_OPTIONS
|
src/node.cc
Outdated
@@ -3729,15 +3729,32 @@ static void PrintHelp() { | |||
} | |||
|
|||
|
|||
static bool ArgIsAllowed(const char* arg, const char* allowed) { | |||
for (;*arg && *allowed; arg++, allowed++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiniest of nits: space after semicolon.
Node supports the variant spellings at the CLI, but not via NODE_OPTIONS, eventually someone (other than @richardlau ) is going to report this a bug, better to preempt. This PR makes |
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Convinced
@@ -60,7 +60,12 @@ if (common.hasCrypto) { | |||
} | |||
|
|||
// V8 options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you fix the strange indent?
src/node.cc
Outdated
if (*arg == '=') | ||
return true; | ||
|
||
return *arg == *allowed; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT this could be return true
?
@@ -60,7 +60,12 @@ if (common.hasCrypto) { | |||
} | |||
|
|||
// V8 options | |||
expect('--abort-on-uncaught-exception', 'B\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: define const printB_expectedOutput = 'B\n';
(Actualy I think '^B\n$'
would be better).
e39106d
to
2a2bba2
Compare
2a2bba2
to
083a4df
Compare
Jenkins built the wrong commit last time, not sure why, trying again. |
V8 options allow either '_' or '-' to be used in options as a seperator, such as "--abort-on_uncaught-exception". Allow these case variations when used with NODE_OPTIONS. PR-URL: #14093 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]>
083a4df
to
97a6aa9
Compare
Landed in 97a6aa9 |
V8 options allow either '_' or '-' to be used in options as a seperator, such as "--abort-on_uncaught-exception". Allow these case variations when used with NODE_OPTIONS. PR-URL: #14093 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]>
V8 options allow either '_' or '-' to be used in options as a seperator, such as "--abort-on_uncaught-exception". Allow these case variations when used with NODE_OPTIONS. PR-URL: #14093 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]>
V8 options allow either '_' or '-' to be used in options as a seperator, such as "--abort-on_uncaught-exception". Allow these case variations when used with NODE_OPTIONS. PR-URL: #14093 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]>
@nodejs/lts I know we just did a semver-minor for 6.x, and thus it probably won't happen for a while, but it seems like it'd be helpful for people if we could backport this at some point, the errors you get with different versions of node are pretty opaque (see #16999). |
I'd be up for considering this semver patch if we assume it likely should have landed in 6.12.0 |
@MylesBorins makes sense, the actual feature (supporting the args in Thoughts on how we avoid forgetting to include this in the next patch? Maybe just land on staging now? |
Yup!
…On Nov 14, 2017 8:38 AM, "Gibson Fahnestock" ***@***.***> wrote:
@MylesBorins <https://github.com/mylesborins> makes sense, the actual
feature (supporting the args in NODE_OPTIONS) landed already, not
supporting the alternatives would be a bug fix.
Thoughts on how we avoid forgetting to include this in the next patch?
Maybe just land on staging now?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#14093 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAecVyA5sjepqCaisZC3XJLcXOX4d7g8ks5s2Ze2gaJpZM4OO5QD>
.
|
V8 options allow either '_' or '-' to be used in options as a seperator, such as "--abort-on_uncaught-exception". Allow these case variations when used with NODE_OPTIONS. PR-URL: #14093 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]>
I've landed this on v6.x-staging and am going to be shipping it as semver patch @nodejs/lts please lmk if you have concerns |
V8 options allow either '_' or '-' to be used in options as a seperator, such as "--abort-on_uncaught-exception". Allow these case variations when used with NODE_OPTIONS. PR-URL: #14093 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]>
V8 options allow either '_' or '-' to be used in options as a seperator, such as "--abort-on_uncaught-exception". Allow these case variations when used with NODE_OPTIONS. PR-URL: #14093 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Refael Ackermann <[email protected]> Reviewed-By: James M Snell <[email protected]>
V8 options allow either '_' or '-' to be used in options as a seperator,
such as "--abort-on_uncaught-exception". Allow these case variations
when used with NODE_OPTIONS.
@richardlau , re #13932 (comment)
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
src