Closed simon-whitehead closed 7 years ago
Also one other potential noteworthy change.
The original tests allowed different length
and data
length inputs. For example, create
with a length of 10 but a slice with length 5 would result in a 0 padded slice with a length of 10.
The issue itself seems to suggest this shouldn't be possible and so after the change was made, this situation wasn't possible and I have updated the existing tests to reflect that.
There are uses of ArrayBuffer::create and Uint8ClampedArray::Create and in Servo right now, and https://github.com/servo/servo/pull/15427 adds more typed array creation.
This looks great! Thank you for working on this! @bors-servo: r+
:pushpin: Commit 86f06e4 has been approved by jdm
:hourglass: Testing commit 86f06e4 with merge 901b1b5...
:sunny: Test successful - status-appveyor, status-travis Approved by: jdm Pushing 901b1b548d07170ecc7aa36da6ddc0f14b8cbac7 to master...
No problem! Thanks for merging so quickly! :smiley:
(Ps: this was such a painless process. I will look out for more issues I can help with :+1:)
Issue: https://github.com/servo/rust-mozjs/issues/336
Changes
TypedArray::create
signature to accept a newCreateWith
argument in place of thelength
anddata
arguments.Includes similar tests to what was already there using the new enum.
Some notes:
/* */
block comments are now//
single line comments. And some other multi-line code has been changed to single line code. If this is an issue let me know and I'll disable rustfmt and revert those changes back.TypedArray::create
directly. I may have missed something though.Feedback welcome.
@jdm - tagging you since you opened the issue (I hope thats okay?)
This change is