Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
src: remove calls to deprecated v8 functions (IntegerValue)#22129
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
nodejs-github-bot commented Aug 4, 2018
src/node.cc Outdated
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.
Can you add CHECK(args[0]->IsInteger());?
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.
There is no v8::Value::IsInteger method.
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.
So, I looked at V8's implementation of the Integer class and here is what I found:
Integer::Value()can be called on anyNumber. The value is cast toint64_t..As<Integer>()can also be called on anyNumber. The CheckCast doesobj->IsNumber().
src/node_buffer.cc Outdated
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.
(ditto, and everywhere else where it’s not obvious that the value already is an integer)
Uh oh!
There was an error while loading. Please reload this page.
src/process_wrap.cc Outdated
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 should also be checked first before converting, I’d say.
lib/buffer.js Outdated
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 is already done inside of bidirectionalIndexOf
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
2d67e9f to 778ffc7Comparetargos commented Sep 1, 2018
@addaleax I think this one is also ready. Copying my inline response from yesterday: So, I looked at V8's implementation of the
|
targos commented Sep 1, 2018
addaleax left a comment
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 but casting Number to Integer seems like relying on V8 implementation details, even if it currently works.
I would feel more comfortable if we could add this pattern to the V8 API cctest suite first?
src/node.cc Outdated
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.
If you happen to be able to test it on Windows without much extra work – I think the cast here is unnecessary.
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.
It compiles fine, thanks
targos commented Sep 2, 2018
I created a CL to add cctests: https://chromium-review.googlesource.com/c/v8/v8/+/1200983 |
addaleax commented Sep 2, 2018
@targos Thank you :) |
jasnell commented Sep 4, 2018
Needs a rebase now unfortunately. |
Remove all calls to deprecated v8 functions (here: Value::IntegerValue) inside the code (src directory only). Co-authored-by: Michaël Zasso <[email protected]>
e59d646 to 76e79b1Comparetargos commented Sep 4, 2018
Rebased |
targos commented Sep 5, 2018 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
The V8 CL landed. This is ready. New CI: https://ci.nodejs.org/job/node-test-pull-request/17025/ Edit: Windows rebuild: https://ci.nodejs.org/job/node-test-commit-windows-fanned/20550/ |
targos commented Sep 5, 2018
Landed in f464ac3 |
Remove all calls to deprecated v8 functions (here: Value::IntegerValue) inside the code (src directory only). Co-authored-by: Michaël Zasso <[email protected]> PR-URL: #22129 Reviewed-By: Anna Henningsen <[email protected]>
Remove all calls to deprecated v8 functions (here: Value::IntegerValue) inside the code (src directory only). Co-authored-by: Michaël Zasso <[email protected]> PR-URL: #22129 Reviewed-By: Anna Henningsen <[email protected]>
Remove all calls to deprecated v8 functions (here: Value::IntegerValue) inside the code (src directory only). Co-authored-by: Michaël Zasso <[email protected]> PR-URL: #22129 Reviewed-By: Anna Henningsen <[email protected]>
2555cb4 introduced a crash when a non-number value was passed to `ParseArrayIndex()`. We do not always have JS typechecking for that in place, though. This returns back to the previous behavior of coercing values to integers, which is certainly questionable. Refs: nodejs#22129Fixes: nodejs#23668
2555cb4 introduced a crash when a non-number value was passed to `ParseArrayIndex()`. We do not always have JS typechecking for that in place, though. This returns back to the previous behavior of coercing values to integers, which is certainly questionable. Refs: nodejs#22129Fixes: nodejs#23668
2555cb4 introduced a crash when a non-number value was passed to `ParseArrayIndex()`. We do not always have JS typechecking for that in place, though. This returns back to the previous behavior of coercing values to integers, which is certainly questionable. Refs: #22129Fixes: #23668 PR-URL: #25154 Reviewed-By: James M Snell <[email protected]>
2555cb4 introduced a crash when a non-number value was passed to `ParseArrayIndex()`. We do not always have JS typechecking for that in place, though. This returns back to the previous behavior of coercing values to integers, which is certainly questionable. Refs: #22129Fixes: #23668 PR-URL: #25154 Reviewed-By: James M Snell <[email protected]>
2555cb4 introduced a crash when a non-number value was passed to `ParseArrayIndex()`. We do not always have JS typechecking for that in place, though. This returns back to the previous behavior of coercing values to integers, which is certainly questionable. Refs: nodejs#22129Fixes: nodejs#23668 PR-URL: nodejs#25154 Reviewed-By: James M Snell <[email protected]>
Remove all calls to deprecated v8 functions (here:
Value::IntegerValue) inside the code (src directory only).
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes/cc @addaleax@hashseed