-
Notifications
You must be signed in to change notification settings - Fork 30k
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
test: ensure error function call on inspector disabled #23586
Conversation
We are migrating towards using internalBinding(\'options\').getOptions() instead of process.binding(\'config\') to access the value of the --experimental-vm-modules command line option.
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.
Great first contribution!
|
||
inspector.sendInspectorCommand( | ||
common.mustNotCall('Inspector callback should not be called'), | ||
common.mustCall(restoreProcessVar, 1), |
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.
Hi, @madeinjam! Welcome and thanks for the pull request! I believe restoreProcessVar()
can be removed from the file. The process exits, so there's no need to reset the value.
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.
Hi @Trott ! I made the change, thank you!
If the process.config.variables.v8_enable_inspector is undefined or set to 0 and the sendInspectorCommand function is called, it should call the error function and should NOT call the callback function.
3379a04
to
2431bca
Compare
Since the process exists after the test, there is no need to backup and restore the process.config.variables.v8_enable_inspector variable.
Collaborators, 👍 here to approve fast-tracking. |
Landed in 9d1c9d7 |
Thanks for the contribution! 🎉 (If you're interested in other possible contributions to Node.js but don't have a good idea of where to start looking, some ideas are posted at https://www.nodetodo.org/next-steps/.) |
We are migrating towards using internalBinding(\'options\').getOptions() instead of process.binding(\'config\') to access the value of the --experimental-vm-modules command line option. PR-URL: nodejs#23586 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
We are migrating towards using internalBinding(\'options\').getOptions() instead of process.binding(\'config\') to access the value of the --experimental-vm-modules command line option. PR-URL: #23586 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
We are migrating towards using internalBinding(\'options\').getOptions() instead of process.binding(\'config\') to access the value of the --experimental-vm-modules command line option. PR-URL: #23586 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
We are migrating towards using internalBinding(\'options\').getOptions() instead of process.binding(\'config\') to access the value of the --experimental-vm-modules command line option. PR-URL: #23586 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
We are migrating towards using internalBinding(\'options\').getOptions() instead of process.binding(\'config\') to access the value of the --experimental-vm-modules command line option. PR-URL: #23586 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
We are migrating towards using internalBinding(\'options\').getOptions() instead of process.binding(\'config\') to access the value of the --experimental-vm-modules command line option. PR-URL: #23586 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
If the process.config.variables.v8_enable_inspector
is undefined or set to 0 and the sendInspectorCommand
function is called, it should call the error function
and should NOT call the callback function.
Test added to cover ./internal/util/inspector.js L4
https://coverage.nodejs.org/coverage-be346d9d32e0aacc/root/internal/util/inspector.js.html#L4
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes