Closed
Bug 1113722
Opened 10 years ago
Closed 10 years ago
Implement %TypedArray%.prototype.fill
Categories
(Core :: JavaScript: Standard Library, defect)
Tracking
()
RESOLVED
FIXED
mozilla37
People
(Reporter: evilpie, Assigned: evilpie)
References
Details
(Keywords: dev-doc-complete, Whiteboard: [DocArea=JS])
Attachments
(1 file)
7.07 KB,
patch
|
till
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Attachment #8539357 -
Flags: review?(till)
Updated•10 years ago
|
Keywords: dev-doc-needed
Comment on attachment 8539357 [details] [diff] [review]
typedarray-fill
Review of attachment 8539357 [details] [diff] [review]:
-----------------------------------------------------------------
::: js/src/builtin/TypedArray.js
@@ +1,5 @@
> /* This Source Code Form is subject to the terms of the Mozilla Public
> * License, v. 2.0. If a copy of the MPL was not distributed with this
> * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
>
> +// ES6 draft rev28 (2014/10/14) 22.2.3.8 %TypedArray%.prototype.find(value [, start [, end ]])
s/find/fill/
::: js/src/tests/ecma_6/TypedArray/fill.js
@@ +58,5 @@
> + /* new Proxy(new constructor(), {}) // this probably should throw */
> + ];
> + nonTypedArrays.forEach(nonTypedArray => {
> + assertThrowsInstanceOf(function() {
> + constructor.prototype.call.call(nonTypedArray, 1);
s/call/fill/1
Comment 2•10 years ago
|
||
Comment on attachment 8539357 [details] [diff] [review]
typedarray-fill
Review of attachment 8539357 [details] [diff] [review]:
-----------------------------------------------------------------
Very nice, thanks!
::: js/src/builtin/TypedArray.js
@@ +1,5 @@
> /* This Source Code Form is subject to the terms of the Mozilla Public
> * License, v. 2.0. If a copy of the MPL was not distributed with this
> * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
>
> +// ES6 draft rev28 (2014/10/14) 22.2.3.8 %TypedArray%.prototype.find(value [, start [, end ]])
Draft 29 is out, please change the comment accordingly.
::: js/src/tests/ecma_6/TypedArray/fill.js
@@ +10,5 @@
> + Float64Array
> +];
> +
> +for (var constructor of constructors) {
> +
nit: remove blank line
@@ +46,5 @@
> + assertDeepEq(new constructor([1,1,1]).fill(2, "-2", "-1"), new constructor([1,2,1]));
> + assertDeepEq(new constructor([1,1,1]).fill(2, {valueOf: ()=>1}), new constructor([1,2,2]));
> + assertDeepEq(new constructor([1,1,1]).fill(2, 0, {valueOf: ()=>1}), new constructor([2,1,1]));
> +
> + // called from other globals
nit: start full-sentence comments with upper-case letter and end with ".". Here and below
Attachment #8539357 -
Flags: review?(till) → review+
Assignee | ||
Comment 3•10 years ago
|
||
Comment 4•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Updated•10 years ago
|
Whiteboard: [DocArea=JS]
Comment 5•10 years ago
|
||
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/fill
https://developer.mozilla.org/en-US/Firefox/Releases/37#JavaScript
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•