archives

« Bugzilla Issues Index

#2174 — 22.2.1.2 %TypedArray%: Check [[ViewedArrayBuffer]] state before assignment


22.2.1.2 %TypedArray% ( typedArray ), steps 27:

CloneArrayBuffer() is not side-effect free, cf. Get(..., "constructor"). That means it is possible to initialise the TypedArray object twice. Add an additional step before step 27 to check [[ViewedArrayBuffer]] is still `undefined`.

test case:
---
var buf = new ArrayBuffer(1);
Object.defineProperty(buf, "constructor", {
get(){
Object.getPrototypeOf(Int8Array).call(t, 1);
return ArrayBuffer;
}
});
var t = Int8Array[Symbol.create]();
Int8Array.call(t, new Int8Array(buf));
---


fixed in rev21 editor's draft


fixed in rev21 draft