Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upTypedArray::create API accept length or slice #337
Conversation
… slice
|
Also one other potential noteworthy change. The original tests allowed different 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 servo/servo#15427 adds more typed array creation. |
|
This looks great! Thank you for working on this! |
|
|
TypedArray::create API accept length or slice Issue: #336 Changes `TypedArray::create` signature to accept a new `CreateWith` argument in place of the `length` and `data` arguments. Includes similar tests to what was already there using the new enum. Some notes: * My first Servo PR. Yay! * Rustfmt seems to have made some changes. Not sure if thats a problem. The license `/* */` 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. * I didn't bump the crate version. I am not sure about the process around that and looking at other PRs I've noticed none of those bumped the version number either. * I don't yet understand how this applies to Servo. From what I can see everything uses the macro and not `TypedArray::create` directly. I may have missed something though. Feedback welcome. @jdm - tagging you since you opened the issue (I hope thats okay?) <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-mozjs/337) <!-- Reviewable:end -->
|
|
|
No problem! Thanks for merging so quickly! (Ps: this was such a painless process. I will look out for more issues I can help with |
simon-whitehead commentedFeb 11, 2017
•
edited by larsbergstrom
Issue: #336
Changes
TypedArray::createsignature to accept a newCreateWithargument in place of thelengthanddataarguments.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::createdirectly. I may have missed something though.Feedback welcome.
@jdm - tagging you since you opened the issue (I hope thats okay?)
This change is