WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
166476
[JSC] Implement (Shared)ArrayBuffer.prototype.byteLength
https://bugs.webkit.org/show_bug.cgi?id=166476
Summary
[JSC] Implement (Shared)ArrayBuffer.prototype.byteLength
Yusuke Suzuki
Reported
2016-12-25 09:39:22 PST
...
Attachments
Patch
(13.52 KB, patch)
2017-02-09 13:51 PST
,
Yusuke Suzuki
saam
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Yusuke Suzuki
Comment 1
2016-12-25 09:45:49 PST
https://tc39.github.io/ecma262/#sec-get-arraybuffer.prototype.bytelength
Yusuke Suzuki
Comment 2
2016-12-25 10:00:36 PST
We already have SharedArrayBuffer. So when implementing ArrayBuffer.prototype.byteLength, we should refer to the updated one in SharedArrayBuffer spec.
Yusuke Suzuki
Comment 3
2016-12-25 10:00:45 PST
http://tc39.github.io/ecmascript_sharedmem/shmem.html#StructuredData.SharedArrayBuffer.prototype.get_byteLength
Radar WebKit Bug Importer
Comment 4
2017-01-30 15:01:37 PST
<
rdar://problem/30273638
>
JF Bastien
Comment 5
2017-01-30 15:01:56 PST
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.
Yusuke Suzuki
Comment 6
2017-02-09 07:16:28 PST
Start working on this.
Yusuke Suzuki
Comment 7
2017-02-09 13:51:19 PST
Created
attachment 301078
[details]
Patch
Saam Barati
Comment 8
2017-02-10 19:33:12 PST
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()
Yusuke Suzuki
Comment 9
2017-02-11 14:12:14 PST
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.
Yusuke Suzuki
Comment 10
2017-02-11 14:14:18 PST
Committed
r212196
: <
http://trac.webkit.org/changeset/212196
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug