-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #24060 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #24060 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #24060 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #24060 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
@cjihrig should this be backported to |
No, I don't believe so. |
PR-URL: nodejs#24060 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Backport-PR-URL: #27967 PR-URL: #24060 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Backport-PR-URL: #27967 PR-URL: #24060 Reviewed-By: Daniel Bevenius <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes