-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: use maybe versions of methods #16005
Conversation
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.
Thanks, LGTM. CI: https://ci.nodejs.org/job/node-test-pull-request/10437/
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.
This commit looks good.
I commented on two nits, but there's no need to fix them -- we can handle them while landing this PR -- but if you can fix them that'd be even better!
src/inspector_agent.cc
Outdated
@@ -858,7 +859,7 @@ void Open(const FunctionCallbackInfo<Value>& args) { | |||
} | |||
|
|||
if (args.Length() > 2 && args[2]->IsBoolean()) { | |||
wait_for_connect = args[2]->BooleanValue(); | |||
wait_for_connect = args[2]->BooleanValue(env->context()).FromJust(); |
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: one space after =
src/inspector_agent.cc
Outdated
@@ -692,14 +692,15 @@ bool Agent::StartIoThread(bool wait_for_connect) { | |||
// Send message to enable debug in workers | |||
Local<Object> process_object = parent_env_->process_object(); | |||
Local<Value> emit_fn = | |||
process_object->Get(FIXED_ONE_BYTE_STRING(isolate, "emit")); | |||
process_object->Get(context, | |||
FIXED_ONE_BYTE_STRING(isolate, "emit")).ToLocalChecked(); |
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: we would generally write it this way:
Local<Value> emit_fn =
process_object->Get(context, FIXED_ONE_BYTE_STRING(isolate, "emit"))
.ToLocalChecked();
@boutell would you be so kind and please rebase? This contains conflicts at the moment |
Hi, everyone! I rebased to get rid of the merge conflict, and I also took care of @TimothyGu's nits while I was in there. This should be good to go. PTAL. |
@@ -512,14 +512,15 @@ bool Agent::StartIoThread(bool wait_for_connect) { | |||
// Send message to enable debug in workers | |||
Local<Object> process_object = parent_env_->process_object(); | |||
Local<Value> emit_fn = | |||
process_object->Get(FIXED_ONE_BYTE_STRING(isolate, "emit")); | |||
process_object->Get(context, FIXED_ONE_BYTE_STRING(isolate, "emit")) |
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.
Micro-nit: indent by 4 spaces (line continuation)
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.
Fixed while landing.
Landed in 2e8c04b, thank you! 🎉 |
PR-URL: #16005 Fixes: #15864 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #16005 Fixes: #15864 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #16005 Fixes: #15864 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: #16005 Fixes: #15864 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs/node#16005 Fixes: nodejs/node#15864 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs/node#16005 Fixes: nodejs/node#15864 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
PR-URL: nodejs/node#16005 Fixes: nodejs/node#15864 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Invoke newer "maybe" versions of methods for which the old versions have been deprecated, throughout inspector_agent.cc.
Tests exist in test-inspector.js and are passing. If these tests are not sufficiently relevant let me now where I might begin supplying more specific coverage.
Affected core subsystems: inspector.
Implements #15864.