...
https://tc39.github.io/ecma262/#sec-get-arraybuffer.prototype.bytelength
We already have SharedArrayBuffer. So when implementing ArrayBuffer.prototype.byteLength, we should refer to the updated one in SharedArrayBuffer spec.
http://tc39.github.io/ecmascript_sharedmem/shmem.html#StructuredData.SharedArrayBuffer.prototype.get_byteLength
<rdar://problem/30273638>
This seems to be the one reason we're not at 100% in this: http://kangax.github.io/compat-table/es2016plus/ Probably worth doing, it's simple.
Start working on this.
Created attachment 301078 [details] Patch
Comment on attachment 301078 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=301078&action=review r=me > JSTests/stress/array-buffer-byte-length.js:27 > + shouldBe(arrayBuffer.byteLength, 42); > + shouldBe(sharedArrayBuffer.byteLength, 500); Can you also add a test where HasOwnProperty(buffer, "byteLength") is false? > JSTests/stress/array-buffer-byte-length.js:45 > + shouldThrow(() => { > + Object.getOwnPropertyDescriptor(ArrayBuffer.prototype, 'byteLength').get.call(sharedArrayBuffer); > + }, `TypeError: Receiver should not be a shared array buffer`); > + > + shouldThrow(() => { > + Object.getOwnPropertyDescriptor(SharedArrayBuffer.prototype, 'byteLength').get.call(arrayBuffer); > + }, `TypeError: Receiver should be a shared array buffer`); Can you also add tests for the other assertions: - !thisValue.isObject() - !thisValue.arrayBuffer()
Comment on attachment 301078 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=301078&action=review Thanks! >> JSTests/stress/array-buffer-byte-length.js:27 >> + shouldBe(sharedArrayBuffer.byteLength, 500); > > Can you also add a test where HasOwnProperty(buffer, "byteLength") is false? Added. >> JSTests/stress/array-buffer-byte-length.js:45 >> + }, `TypeError: Receiver should be a shared array buffer`); > > Can you also add tests for the other assertions: > - !thisValue.isObject() > - !thisValue.arrayBuffer() Added.
Committed r212196: <http://trac.webkit.org/changeset/212196>