Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(647)

Issue 1237583005: Only evaluate length once in %TypedArray%.prototype.set (Closed)

Created:
5 years, 5 months ago by Eric Caruso
Modified:
5 years, 4 months ago
Reviewers:
Dan Ehrenberg, adamk
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Only evaluate length once in %TypedArray%.prototype.set The ES6 spec for this function declares that ToLength should only be called once. We were evaluating it multiple times, so if length was an object with a valueOf method, we could see effects take place multiple times. R=littledan@chromium.org LOG=N BUG=v8:4218 Committed: https://crrev.com/df999c9790e96a72a6c56e67182a144b0e718591 Cr-Commit-Position: refs/heads/master@{#30240}

Patch Set 1 #

Total comments: 1

Patch Set 2 : Add sanity check #

Patch Set 3 : Add more cases to the test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -0 lines) Patch
M src/typedarray.js View 1 chunk +1 line, -0 lines 0 comments Download
A test/mjsunit/es6/typedarray-set-length.js View 1 2 1 chunk +54 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (3 generated)
Dan Ehrenberg
Looks good, just a minor suggestion. https://codereview.chromium.org/1237583005/diff/1/test/mjsunit/es6/typedarray-set-length.js File test/mjsunit/es6/typedarray-set-length.js (right): https://codereview.chromium.org/1237583005/diff/1/test/mjsunit/es6/typedarray-set-length.js#newcode27 test/mjsunit/es6/typedarray-set-length.js:27: a.set({length: {valueOf: lengthValue}}); ...
5 years, 5 months ago (2015-07-13 23:47:30 UTC) #2
adamk
Looking good. Can you also add some tests demonstrating that you're calling $toLength (and not ...
5 years, 5 months ago (2015-07-14 00:14:19 UTC) #4
Eric Caruso
PTAL, thanks.
5 years, 4 months ago (2015-08-19 00:40:43 UTC) #5
Dan Ehrenberg
lgtm Wow, very well-tested.
5 years, 4 months ago (2015-08-19 00:41:04 UTC) #6
adamk
lgtm!
5 years, 4 months ago (2015-08-19 00:46:43 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1237583005/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1237583005/40001
5 years, 4 months ago (2015-08-19 00:47:36 UTC) #9
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 4 months ago (2015-08-19 01:33:03 UTC) #10
commit-bot: I haz the power
5 years, 4 months ago (2015-08-19 01:33:18 UTC) #11
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/df999c9790e96a72a6c56e67182a144b0e718591
Cr-Commit-Position: refs/heads/master@{#30240}

Powered by Google App Engine
This is Rietveld 408576698