Closed
Bug 1291003
Opened 8 years ago
Closed 8 years ago
%TypedArray%.prototype.subarray: Move TypedArrayByteOffset before ToInteger
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
mozilla52
People
(Reporter: anba, Assigned: anba)
Details
Attachments
(1 file)
(deleted),
patch
|
evilpie
:
review+
|
Details | Diff | Splinter Review |
Test case:
---
ta = new Int8Array(new ArrayBuffer(2), 1, 1);
ta.constructor = {
[Symbol.species]: function(ab, offset, length) {
print("offset", offset);
return new Int8Array(1);
}
};
ta.subarray({
valueOf() {
detachArrayBuffer(ta.buffer, "same-data")
return 0;
}
});
---
Expected: Prints "offset 1"
Actual: Prints "offset 0"
It's probably easier to move the TypedArrayByteOffset [1] call before the ToInteger [2] calls, compared to not zeroing [[ByteOffset]] when detaching the array buffer.
[1] http://hg.mozilla.org/mozilla-central/file/ffac2798999c/js/src/builtin/TypedArray.js#l1140
[2] https://dxr.mozilla.org/mozilla-central/source/js/src/builtin/TypedArray.js#1124
Assignee | ||
Comment 1•8 years ago
|
||
Just a silly spec compliance edge case. :-)
Assignee: nobody → andrebargull
Status: NEW → ASSIGNED
Attachment #8806022 -
Flags: review?(evilpies)
Assignee | ||
Comment 2•8 years ago
|
||
Comment 3•8 years ago
|
||
Comment on attachment 8806022 [details] [diff] [review]
bug1291003.patch
Review of attachment 8806022 [details] [diff] [review]:
-----------------------------------------------------------------
Ooookay
Attachment #8806022 -
Flags: review?(evilpies) → review+
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d3041026a921
Compute byteOffset before calling ToInteger in %TypedArray%.prototype.subarray. r=evilpie
Keywords: checkin-needed
Comment 5•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in
before you can comment on or make changes to this bug.
Description
•