Closed Bug 1232264 Opened 4 years ago Closed 4 years ago

Make the SharedArrayBuffer constructor throw if invoked without 'new'

Categories

(Core :: JavaScript: Standard Library, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla46
Tracking Status
firefox45 --- affected
firefox46 --- fixed

People

(Reporter: anba, Assigned: lth)

References

(Blocks 1 open bug)

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

Similar to bug 1214936: Calling `SharedArrayBuffer` without `new` should throw a TypeError [1].

Test case:
---
SharedArrayBuffer(new SharedArrayBuffer(1))
---

Expected: Throws TypeError
Actual: Returns input SharedArrayBuffer object


[1] http://lars-t-hansen.github.io/ecmascript_sharedmem/shmem.html#StructuredData.SharedArrayBuffer.constructor.withLength
My bad.
Blocks: 1225039
Attachment #8698421 - Flags: review?(arai.unmht)
Assignee: nobody → lhansen
Status: NEW → ASSIGNED
Comment on attachment 8698421 [details] [diff] [review]
SharedArrayBuffer is only a constructor

Review of attachment 8698421 [details] [diff] [review]:
-----------------------------------------------------------------

:)
Attachment #8698421 - Flags: review?(arai.unmht) → review+
https://hg.mozilla.org/mozilla-central/rev/4ebd9b147a2a
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
This may not require dev docs since SharedArrayBuffer is only available on Nightly so far...
kohei, don't know what the rules are for that, but SharedArrayBuffer will ride the trains (behind a pref) from FF46, see bug 1225406 (which btw is flagged dev-doc-needed).
Putting back ddn. I am going to work on SAB docs soon and this is a nice reminder to document this behavior.
Keywords: dev-doc-needed
You need to log in before you can comment on or make changes to this bug.