New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Normative: Ensure that TypedArray.prototype.fill does one coercion #856

Merged
merged 1 commit into from Mar 31, 2017

Conversation

Projects
None yet
5 participants
@littledan
Member

littledan commented Mar 22, 2017

Previously, TypedArray.prototype.fill failed to coerce its value
argument multiple in the beginning of the definition, instead coercing
it when writing into the TypedArray each time. This patch tweaks
the definition to perform the coercion once.

Fixes #855

Normative: Ensure that TypedArray.prototype.fill does one coercion
Previously, TypedArray.prototype.fill failed to coerce its value
argument multiple in the beginning of the definition, instead coercing
it when writing into the TypedArray each time. This patch tweaks
the definition to perform the coercion once.

littledan added a commit to littledan/test262 that referenced this pull request Mar 22, 2017

Test for TypedArray.prototype.fill semantics change
The change is proposed in tc39/ecma262#856
as a fix to tc39/ecma262#855

Here, the ToNumber coercion is done only once, rather than on each
iteration. It does not appear that there were previously any
tests against repeated coercion for this parameter previously.

Tested this test against V8, which failed, as V8 implements the
current spec rather than the proposed one.
@leobalter

This comment has been minimized.

Member

leobalter commented Mar 27, 2017

this reached consensus in March 22nd at the last TC39 meeting.

@leobalter

This comment has been minimized.

Member

leobalter commented Mar 27, 2017

@bterlson should we have a "has consensus" label for unmerged PRs/issues?

leobalter added a commit to tc39/test262 that referenced this pull request Mar 27, 2017

Test for TypedArray.prototype.fill semantics change (#927)
The change is proposed in tc39/ecma262#856
as a fix to tc39/ecma262#855

Here, the ToNumber coercion is done only once, rather than on each
iteration. It does not appear that there were previously any
tests against repeated coercion for this parameter previously.

Tested this test against V8, which failed, as V8 implements the
current spec rather than the proposed one.
@ljharb

This comment has been minimized.

Member

ljharb commented Mar 27, 2017

@leobalter good idea; i took the liberty to make one

@bterlson bterlson merged commit e76322b into tc39:master Mar 31, 2017

kisg pushed a commit to paul99/v8mips that referenced this pull request Apr 4, 2017

[typedarray] ToNumber coercion is done only once for TA.p.fill
Update according to new spec change at
tc39/ecma262#856

- Call ToNumber only once in BUILTIN
- Remove unused FillNumberSlowPath
- FillImpl assumes obj_value->IsNumber() is true
- Update test

Bug:v8:5929,chromium:702902

Change-Id: Ic83e6754d043582955b81c76e68f95e1c6b7e901
Reviewed-on: https://chromium-review.googlesource.com/465646
Reviewed-by: Daniel Ehrenberg <littledan@chromium.org>
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#44373}

@rwaldron rwaldron added the has tests label Jun 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment