Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
src: use option parser for expose_internals#12245
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
sam-github commented Apr 5, 2017
src/node.cc Outdated
| READONLY_PROPERTY(process, "_forceRepl", True(env->isolate())); | ||
| } | ||
| // -r,--require |
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.
Actually can you add a space here after the comma to be consistent with the other existing comments?
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.
done, thanks (also, fixed up the existing comment which did not use a space)
src/node.cc Outdated
| READONLY_PROPERTY(process, "_debugWaitConnect", True(env->isolate())); | ||
| } | ||
| // --expose_internals,--expose-internals |
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.
Ditto
jasnell left a comment
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.
In addition to the other issue mentioned, this should have a minimal test to verify that the property is set.
src/node.cc Outdated
| // --expose_internals,--expose-internals | ||
| if (expose_internals){ | ||
| READONLY_PROPERTY(process, "_exposeInternals", True(env->isolate())); | ||
| } |
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.
Would prefer to use process.binding('config') for this rather than adding a new _-prefixed property off process
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.
PTAL, there is no new property created off of process (its deleted later). I'll add an assertion of that fact to the existing test.
ed9c2e6 to 8675a23Comparesrc/node.cc Outdated
| } | ||
| // --expose_internals, --expose-internals | ||
| // Note that this is not exposed as a process property, it is deleted when |
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.
@jasnell PTAL
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.
not sure the note is necessary, many setup properties do this
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.
I didn't think it was necessary either, but it confused @jasnell - James, what do you think?
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.
I want confused. I'm not fond of this pattern. Exposing via process.binding('config') is preferable to me.
| constassert=require('assert'); | ||
| assert.strictEqual(typeofrequire('internal/freelist').FreeList,'function'); | ||
| assert(!('_exposeInternals'inprocess),'no process property is leaked'); |
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.
@jasnell PTAL, I deliberately am making no change to the process properties (for cleanliness, and because it may potentically be backwards incompat, and also because its unnecessary, we can find if internal modules were exposed pretty easily by just trying to require one and seeing what happens, which is unusual to want to know, but possible).
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.
see
Lines 1219 to 1221 in 8460284
| env->process_object()->Delete( | |
| env->context(), | |
| FIXED_ONE_BYTE_STRING(args.GetIsolate(), "_setupPromises")).FromJust(); |
addaleax commented Apr 10, 2017
@sam-github This might also need a rebase after landing #12241. |
jasnell left a comment
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.
@addaleax I'd still prefer the process.binding('config') change to be honest.
sam-github commented Apr 10, 2017
@jasnell what change? You saw the property is never visible, and unit test to that effect? You want the property put somewhere else for its brief lifetime? |
4e22b98 to 913a194Comparesam-github commented Apr 10, 2017
@jasnell I somehow missed your earlier comment, sorry. You actually want this exposed as a new config property? I don't think I'm on-board for that. I'm trying to factor out an oddity where process.argv is re-parsed after it was already parsed, which strikes me as undesireable, not add new APIs that haven't been requested.
|
913a194 to 8b07404Comparejasnell commented Apr 11, 2017
No, not |
sam-github commented Apr 11, 2017
OK, I'll go look |
88ca10f to d746bcaCompared746bca to 1b24364Comparesam-github commented Apr 12, 2017
A few of the CLI option values exposed as properties on the process object were missing a comment, fix this. PR-URL: #12245 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
bootstrap_node.js was directly parsing process.execArgv to see if internals should be exposed, even though the argv was already parsed by node. This is unusual and unnecessary, change it to set the option value from the parser onto the config binding. PR-URL: #12245 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1b24364 to 8086cb6Comparegibfahn commented Jun 18, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@sam-github when you merge multiple commits, could you still comment with |
gibfahn commented Jun 18, 2017
Should this be backported to |
A few of the CLI option values exposed as properties on the process object were missing a comment, fix this. PR-URL: nodejs#12245 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
bootstrap_node.js was directly parsing process.execArgv to see if internals should be exposed, even though the argv was already parsed by node. This is unusual and unnecessary, change it to set the option value from the parser onto the config binding. PR-URL: nodejs#12245 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
sam-github commented Jul 25, 2017
backported: #14483 |
A few of the CLI option values exposed as properties on the process object were missing a comment, fix this. Backport-PR-URL: #14483 PR-URL: #12245 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
bootstrap_node.js was directly parsing process.execArgv to see if internals should be exposed, even though the argv was already parsed by node. This is unusual and unnecessary, change it to set the option value from the parser onto the config binding. Backport-PR-URL: #14483 PR-URL: #12245 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
A few of the CLI option values exposed as properties on the process object were missing a comment, fix this. Backport-PR-URL: #14483 PR-URL: #12245 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
bootstrap_node.js was directly parsing process.execArgv to see if internals should be exposed, even though the argv was already parsed by node. This is unusual and unnecessary, change it to set the option value from the parser onto the config binding. Backport-PR-URL: #14483 PR-URL: #12245 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
A few of the CLI option values exposed as properties on the process object were missing a comment, fix this. Backport-PR-URL: #14483 PR-URL: #12245 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
bootstrap_node.js was directly parsing process.execArgv to see if internals should be exposed, even though the argv was already parsed by node. This is unusual and unnecessary, change it to set the option value from the parser onto the config binding. Backport-PR-URL: #14483 PR-URL: #12245 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
bootstrap_node.js was directly parsing process.execArgv to see if
internals should be exposed, even though the argv was already parsed by
node. This is unusual and unnecessary, change it to set the option value
from the parser onto the process object, as is done for the other CLI
options.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
src