-
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: replace some deprecated uses of Get() and Set() #24060
Conversation
@@ -736,7 +736,7 @@ inline void Environment::SetMethod(v8::Local<v8::Object> that, | |||
const v8::NewStringType type = v8::NewStringType::kInternalized; | |||
v8::Local<v8::String> name_string = | |||
v8::String::NewFromUtf8(isolate(), name, type).ToLocalChecked(); | |||
that->Set(name_string, function); | |||
that->Set(context, name_string, function).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.
Shouldn't this return if it's empty? Also other FromJust
below
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.
@joyeecheung I'm not sure that it matters in these two cases.
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 don’t think we can really signal an error here without making SetMethod()
itself return a Maybe<>
…
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 hmm, yeah, the caller can handle that as well, but this is mostly used in Initialize
anyways
CI: https://ci.nodejs.org/job/node-test-pull-request/18385/ EDIT(cjihrig): CI was yellow |
@@ -736,7 +736,7 @@ inline void Environment::SetMethod(v8::Local<v8::Object> that, | |||
const v8::NewStringType type = v8::NewStringType::kInternalized; | |||
v8::Local<v8::String> name_string = | |||
v8::String::NewFromUtf8(isolate(), name, type).ToLocalChecked(); | |||
that->Set(name_string, function); | |||
that->Set(context, name_string, function).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.
I don’t think we can really signal an error here without making SetMethod()
itself return a Maybe<>
…
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: #24060 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: #24060 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: #24060 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: #24060 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
@cjihrig should this be backported to |
No, I don't believe so. |
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes