-
Notifications
You must be signed in to change notification settings - Fork 29.9k
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
contextify: use offset/length from Uint8Array #4947
Conversation
Do not blindly take data from underlying `ArrayBuffer`, use `ByteOffset`/`ByteLength` of `Uint8Array` itself. Additionally, fix tests that weren't actually properly running because of V8's internal code cache. The code should be different, otherwise the cached data won't be used at all. Fix: nodejs#4939
@@ -4,30 +4,58 @@ const assert = require('assert'); | |||
const vm = require('vm'); | |||
const Buffer = require('buffer').Buffer; | |||
|
|||
const originalSource = '(function bcd() { return \'original\'; })'; | |||
function getSource(tag) { | |||
return '(function ' + tag + '() { return \'' + tag + '\'; })'; |
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.
Template string?
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.
Ack.
LGTM with a suggestion. |
Landed in b4ece1b, thank you! |
Do not blindly take data from underlying `ArrayBuffer`, use `ByteOffset`/`ByteLength` of `Uint8Array` itself. Additionally, fix tests that weren't actually properly running because of V8's internal code cache. The code should be different, otherwise the cached data won't be used at all. Fix: #4939 PR-URL: #4947 Reviewed-By: Ben Noordhuis <[email protected]>
lts-watch label applied |
Do not blindly take data from underlying `ArrayBuffer`, use `ByteOffset`/`ByteLength` of `Uint8Array` itself. Additionally, fix tests that weren't actually properly running because of V8's internal code cache. The code should be different, otherwise the cached data won't be used at all. Fix: #4939 PR-URL: #4947 Reviewed-By: Ben Noordhuis <[email protected]>
dropping LTS label based on what @indutny said. Feel free to update |
Do not blindly take data from underlying `ArrayBuffer`, use `ByteOffset`/`ByteLength` of `Uint8Array` itself. Additionally, fix tests that weren't actually properly running because of V8's internal code cache. The code should be different, otherwise the cached data won't be used at all. Fix: nodejs#4939 PR-URL: nodejs#4947 Reviewed-By: Ben Noordhuis <[email protected]>
Do not blindly take data from underlying
ArrayBuffer
, useByteOffset
/ByteLength
ofUint8Array
itself.Additionally, fix tests that weren't actually properly running because
of V8's internal code cache. The code should be different, otherwise the
cached data won't be used at all.
Fix: #4939
R = @nodejs/v8 or @trevnorris