-
Notifications
You must be signed in to change notification settings - Fork 499
[immutable-arraybuffer] ArrayBuffer.prototype.sliceToImmutable #4553
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
base: main
Are you sure you want to change the base?
[immutable-arraybuffer] ArrayBuffer.prototype.sliceToImmutable #4553
Conversation
51629c7
to
f9ed2c1
Compare
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.
Minor comments, feel free to merge when resolved
---*/ | ||
|
||
var fn = ArrayBuffer.prototype.sliceToImmutable; | ||
assert.sameValue(typeof fn, "function", "Method must exist."); |
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.
assert.sameValue(typeof fn, "function", "Method must exist."); |
I think this is sufficiently implied by the immutable-arraybuffer
feature flag.
---*/ | ||
|
||
var fn = ArrayBuffer.prototype.sliceToImmutable; | ||
assert.sameValue(typeof fn, "function", "Method must exist."); |
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
var label = badReceivers[i][0]; | ||
var value = badReceivers[i][1]; |
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 will break on implementations without Symbol or BigInt, I think you probably want if (!badReceivers[i]) continue;
---*/ | ||
|
||
var fn = ArrayBuffer.prototype.sliceToImmutable; | ||
assert.sameValue(typeof fn, "function", "Method must exist."); |
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.
Already implied by feature flag.
"sliceToImmutable(" + repr(rawStart) + ", " + repr(rawEnd) + ")"); | ||
assert.compareArray(new Uint8Array(dest), expectContents, | ||
"sliceToImmutable(" + repr(rawStart) + ", " + repr(rawEnd) + ")"); | ||
assert.sameValue(dest.immutable, true, | ||
"sliceToImmutable(" + repr(rawStart) + ", " + repr(rawEnd) + ")"); |
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.
Minor suggestion, add something to these assertion messages to distinguish which assertion is failing (byte length, contents, or immutability) (Same for below)
Ref #4509