-
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
deps: provide more V8 backwards compatibility #23158
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.
LGTM. Worth doing a CITGM run?
/cc @nodejs/v8-update |
CITGM looks a lot nicer now – still a bunch of failures, but nothing related to the V8 changes. CI: https://ci.nodejs.org/job/node-test-pull-request/17506/ (:heavy_check_mark:) |
I think we can simply turn on all the node/deps/v8/gypfiles/features.gypi Lines 137 to 139 in a21af5b
node/deps/v8/include/v8config.h Lines 337 to 349 in a21af5b
editNeed to explicitly add Line 107 in a21af5b
and 'defines': [ 'V8_IMMINENT_DEPRECATION_WARNINGS=1' ], somewhere inLines 164 to 168 in a21af5b
|
I think setting |
Discussion in #23167 |
(please make sure the discussion in #23122 about conflicting with V8 updates is resolved before landing this) |
Does this need to be on the 11.0.0 milestone? |
@jasnell Yes – it unbreaks a large number of native add-ons, and in particular makes CITGM return more meaningful results again. |
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 am no expert in this area, but the reason we are doing this and the changes are straight forward. So LGTM.
Reverting this enables us to provide slower, but longer-lasting replacements for the deprecated APIs. Original commit message: Put back deleted V8_DEPRECATE_SOON methods This partially reverts https://chromium-review.googlesource.com/c/v8/v8/+/1177861, which deleted many V8_DEPRECATE_SOON methods rather than moving them to V8_DEPRECATED first. This puts them back and marks them V8_DEPRECATED. Note V8_DEPRECATED that were deleted in the same CL stay deleted. NOTRY=true NOPRESUBMIT=true NOTREECHECKS=true Bug: v8:7786, v8:8240 Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng Change-Id: I00330036d957f98dab403465b25e30d8382aac22 Reviewed-on: https://chromium-review.googlesource.com/1251422 Commit-Queue: Dan Elphick <delphick@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Reviewed-by: Michael Hablich <hablich@chromium.org> Cr-Commit-Position: refs/branch-heads/7.0@{nodejs#49} Cr-Branched-From: 6e2adae6f7f8e891cfd01f3280482b20590427a6-refs/heads/7.0.276@{#1} Cr-Branched-From: bc08a8624cbbea7a2d30071472bc73ad9544eadf-refs/heads/master@{nodejs#55424} Refs: v8/v8@9136dd8 Refs: nodejs#23122
Add back a number deprecated APIs, using shims that should work well enough at least for the duration of Node 11 and do not come with significant maintenance overhead. Refs: nodejs#23122
@hashseed @targos I’ve updated this – does this solution seem okay to you? CI: https://ci.nodejs.org/job/node-test-pull-request/17637/ |
deps/v8/src/api.cc
Outdated
@@ -3876,6 +3888,36 @@ void v8::RegExp::CheckCast(v8::Value* that) { | |||
} | |||
|
|||
|
|||
bool Value::BooleanValue() const { | |||
return BooleanValue(Isolate::GetCurrent()->GetCurrentContext()) | |||
.FromMaybe(false); |
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.
Depending on what behavior you prefer, you may want to use FromJust()
here to cause a crash rather than failing silently.
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.
Done – this is currently only theoretical, right?
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.
Ah. Sorry. I actually meant all the other uses of FromMaybe, like in Value::IntegerValue
. BooleanValue
can actually never throw, so in newer V8 we restored this API already, without the Maybe
return 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.
Okay, I understand – that would at least technically be a breaking change, I guess, and we’re past the cut-off date for that for Node 11
Landed in 2ba19ff...48d1335 |
Refs: v8/v8@7.0.276.22...7.0.276.24 PR-URL: #23158 Refs: #23122 Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reverting this enables us to provide slower, but longer-lasting replacements for the deprecated APIs. Original commit message: Put back deleted V8_DEPRECATE_SOON methods This partially reverts https://chromium-review.googlesource.com/c/v8/v8/+/1177861, which deleted many V8_DEPRECATE_SOON methods rather than moving them to V8_DEPRECATED first. This puts them back and marks them V8_DEPRECATED. Note V8_DEPRECATED that were deleted in the same CL stay deleted. NOTRY=true NOPRESUBMIT=true NOTREECHECKS=true Bug: v8:7786, v8:8240 Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng Change-Id: I00330036d957f98dab403465b25e30d8382aac22 Reviewed-on: https://chromium-review.googlesource.com/1251422 Commit-Queue: Dan Elphick <delphick@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Reviewed-by: Michael Hablich <hablich@chromium.org> Cr-Commit-Position: refs/branch-heads/7.0@{#49} Cr-Branched-From: 6e2adae6f7f8e891cfd01f3280482b20590427a6-refs/heads/7.0.276@{#1} Cr-Branched-From: bc08a8624cbbea7a2d30071472bc73ad9544eadf-refs/heads/master@{#55424} Refs: v8/v8@9136dd8 Refs: #23122 PR-URL: #23158 Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Add back a number deprecated APIs, using shims that should work well enough at least for the duration of Node 11 and do not come with significant maintenance overhead. Refs: #23122 PR-URL: #23158 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Refs: v8/v8@7.0.276.22...7.0.276.24 PR-URL: #23158 Refs: #23122 Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reverting this enables us to provide slower, but longer-lasting replacements for the deprecated APIs. Original commit message: Put back deleted V8_DEPRECATE_SOON methods This partially reverts https://chromium-review.googlesource.com/c/v8/v8/+/1177861, which deleted many V8_DEPRECATE_SOON methods rather than moving them to V8_DEPRECATED first. This puts them back and marks them V8_DEPRECATED. Note V8_DEPRECATED that were deleted in the same CL stay deleted. NOTRY=true NOPRESUBMIT=true NOTREECHECKS=true Bug: v8:7786, v8:8240 Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng Change-Id: I00330036d957f98dab403465b25e30d8382aac22 Reviewed-on: https://chromium-review.googlesource.com/1251422 Commit-Queue: Dan Elphick <delphick@chromium.org> Reviewed-by: Yang Guo <yangguo@chromium.org> Reviewed-by: Michael Hablich <hablich@chromium.org> Cr-Commit-Position: refs/branch-heads/7.0@{#49} Cr-Branched-From: 6e2adae6f7f8e891cfd01f3280482b20590427a6-refs/heads/7.0.276@{#1} Cr-Branched-From: bc08a8624cbbea7a2d30071472bc73ad9544eadf-refs/heads/master@{#55424} Refs: v8/v8@9136dd8 Refs: #23122 PR-URL: #23158 Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Michaël Zasso <targos@protonmail.com>
Add back a number deprecated APIs, using shims that should work well enough at least for the duration of Node 11 and do not come with significant maintenance overhead. Refs: #23122 PR-URL: #23158 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This was introduced in 48d1335. Previously, values such as `undefined` would not be coerced properly because `NumberValue()` returns `NaN` for them. Refs: nodejs#23158
This was introduced in 48d1335. Previously, values such as `undefined` would not be coerced properly because `NumberValue()` returns `NaN` for them. Refs: #23158 PR-URL: #23898 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This was introduced in 48d1335. Previously, values such as `undefined` would not be coerced properly because `NumberValue()` returns `NaN` for them. Refs: #23158 PR-URL: #23898 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This was introduced in 48d1335. Previously, values such as `undefined` would not be coerced properly because `NumberValue()` returns `NaN` for them. Refs: #23158 PR-URL: #23898 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Add back a number deprecated APIs, using shims that should work well enough at least for the duration of Node 11 and do not come with significant maintenance overhead. Refs: nodejs/node#23122 PR-URL: nodejs/node#23158 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Michaël Zasso <targos@protonmail.com> Patch-Filename: deps_provide_more_v8_backwards_compatibility.patch
Add back a number deprecated APIs, using shims that should work well enough at least for the duration of Node 11 and do not come with significant maintenance overhead. Refs: nodejs/node#23122 PR-URL: nodejs/node#23158 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Michaël Zasso <targos@protonmail.com> Patch-Filename: deps_provide_more_v8_backwards_compatibility.patch
Add back a number deprecated APIs, using shims that should work well enough at least for the duration of Node 11 and do not come with significant maintenance overhead. Refs: nodejs/node#23122 PR-URL: nodejs/node#23158 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Yang Guo <yangguo@chromium.org> Reviewed-By: Michaël Zasso <targos@protonmail.com> Patch-Filename: deps_provide_more_v8_backwards_compatibility.patch
Add back a number deprecated APIs, using shims that
should work well enough at least for the duration of Node 11
and do not come with significant maintenance overhead.
Refs: #23122
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes