Closed
Bug 1317394
Opened 7 years ago
Closed 6 years ago
DataView.prototype.byteLength and byteOffset should throw when the underlying buffer is detached
Categories
(Core :: JavaScript: Standard Library, defect)
Core
JavaScript: Standard Library
Tracking
()
RESOLVED
FIXED
mozilla57
People
(Reporter: anba, Assigned: evilpie)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
2.95 KB,
patch
|
anba
:
review+
|
Details | Diff | Splinter Review |
Test case: --- var ab = new ArrayBuffer(10); var dv = new DataView(ab) detachArrayBuffer(ab); dv.byteLength; // Or: dv.byteOffset; --- Expected: Throws TypeError Actual: No exception thrown Also see bug 1079853.
Assignee | ||
Comment 1•6 years ago
|
||
Somehow I never uploaded this patch, but I think there is nothing wrong with it.
Assignee: nobody → evilpies
Attachment #8906269 -
Flags: review?(andrebargull)
Reporter | ||
Updated•6 years ago
|
Attachment #8906269 -
Attachment is patch: true
Reporter | ||
Comment 2•6 years ago
|
||
Comment on attachment 8906269 [details] [diff] [review] Throw on detached ArrayBuffer in DataView getters Review of attachment 8906269 [details] [diff] [review]: ----------------------------------------------------------------- Nothing wrong with the patch itself, but I'm wondering about web-compatibility. AFAICS, no other browser is currently throwing a TypeError for detached buffers in the byteLength and byteOffset getters. Do you think it's still okay to let this change ride the trains to release, or is it more safe to restrict it to nightly+beta for a longer time until we're sure it won't break web-sites?
Attachment #8906269 -
Flags: review?(andrebargull) → review+
Assignee | ||
Comment 3•6 years ago
|
||
Oh, maybe that's why I never bothered with this. My feeling tells me DataView aren't actually used much and detached array buffers are probably also not that common. Making it Nightly only at least for the 57 cycle sounds like a good idea anyway.
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/a31657380189 Make DataView getters throw for detached array buffers in Nightly. r=anba
Pushed by evilpies@gmail.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/b7f103d256b9 Fix bustage on CLOSED TREE by changing an old test.
Comment 6•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/a31657380189 https://hg.mozilla.org/mozilla-central/rev/b7f103d256b9
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in
before you can comment on or make changes to this bug.
Description
•