-
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,deps: add isolate parameter to String::Concat #22521
Conversation
Partially backport an upstream commit that deprecates String::Concat without the isolate parameter. This overload has already been removed in V8 7.0. Refs: v8/v8@8a011b5
@targos I think it's actually a good idea to be proactive about it. Having dealt with the issue early on always sounds good to me. |
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.
LGTM overall, with a single comment down below and a minor concern:
The signature of WinapiErrnoException
and ErrnoException
aren't changed, so the isolate
arg had been there all along, right?
Why did we just shift from env()->isolate
to isolate
then? (Like, I agree that we should, but shouldn't it have been done already?)
@@ -6663,6 +6663,11 @@ Local<String> v8::String::Concat(Local<String> left, Local<String> right) { | |||
return Utils::ToLocal(result); | |||
} | |||
|
|||
Local<String> v8::String::Concat(Local<String> left, Local<String> right) { | |||
i::Handle<i::String> left_string = Utils::OpenHandle(*left); |
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.
A bit hacky (opening a handle just to fetch the isolate), but idk if there's a better way. @addaleax do you?
Perhaps one could get the current env
and extract the associated isolate
? Idk how different the result would be, but it's certainly less hacky IMO.
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.
That's just copied from the V8 source code (see the Refs link)
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 get it. It works so it shouldn't be a problem anyway.
Yes, WinapiErrnoException and ErrnoException already receive the isolate as a parameter. Unless I'm missing something, we can and should be using it instead of getting the pointer from the environment. |
As I said, I agree that we should just directly use it, I just had been wondering why it wasn't being used before this patch if the parameter always existed. |
IMHO it's better to review, and to track if this is done in two commits. Quick look at the code seems like it's possible. |
@refack yeah, sorry. I thought the changeset was small enough to not be a problem. I'll do multiple commits for the next PR. |
Landed in 08aad66 |
Partially backport an upstream commit that deprecates String::Concat without the isolate parameter. This overload has already been removed in V8 7.0. PR-URL: #22521 Refs: v8/v8@8a011b5 Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
@targos This would need a backport for v10.x :) |
Oops, looks like we are working on the same thing :) |
@targos If you were on IRC I’d have asked you whether you’re going to do a 10.x this week. 😄 I haven’t done any backporting attempts myself, but if the embedder string is one off, would it make sense to just bump it to the |
@addaleax I'm on IRC now. I'm not really preparing the release btw, just keeping the branch up-to-date.
Good idea. I'll open a PR to do that. |
Partially backport an upstream commit that deprecates String::Concat without the isolate parameter. This overload has already been removed in V8 7.0. PR-URL: #22521 Refs: v8/v8@8a011b5 Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
Partially backport an upstream commit that deprecates String::Concat without the isolate parameter. This overload has already been removed in V8 7.0. PR-URL: #22521 Refs: v8/v8@8a011b5 Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
Partially backport an upstream commit that deprecates String::Concat without the isolate parameter. This overload has already been removed in V8 7.0. PR-URL: #22521 Refs: v8/v8@8a011b5 Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Refael Ackermann <[email protected]>
Partially backport an upstream commit that deprecates String::Concat
without the isolate parameter. This overload has already been removed
in V8 7.0.
Refs: v8/v8@8a011b5
/cc @nodejs/v8-update
I'd like your opinion on this proactive approach about V8 deprecations. If everyone is fine with it, I'm ready to open other PRs for
StackTrace::GetFrame
,String::Write
, etc.I would like to do this because it can be backported to
v10.x
.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes