Implement %TypedArray%.prototype.fill

RESOLVED FIXED in mozilla37

Status

()

RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: evilpie, Assigned: evilpie)

Tracking

({dev-doc-complete})

Trunk
mozilla37
x86_64
Linux
dev-doc-complete
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [DocArea=JS])

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
Attachment #8539357 - Flags: review?(till)
Keywords: dev-doc-needed

Comment 1

4 years ago
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 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+
https://hg.mozilla.org/mozilla-central/rev/3b7cd31a7b22
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla37
Duplicate of this bug: 730880
You need to log in before you can comment on or make changes to this bug.