|
|
Chromium Code Reviews|
Created:
4 years, 10 months ago by Dan Ehrenberg Modified:
4 years, 10 months ago CC:
v8-reviews_googlegroups.com Base URL:
https://chromium.googlesource.com/v8/v8.git@master Target Ref:
refs/pending/heads/master Project:
v8 Visibility:
Public. |
DescriptionUse a for-of loop in Array.from
If Array.from is passed an iterable, then it will copy the contents
to the newly created Array (or subclass). The iteration protocol here
includes calling IteratorClose if the loop is exited early due to an
exception thrown. This patch converts Array.from to use a for-of loop
rather than explicitly invoking the iteration protocol so that, when
IteratorClose is invoked on early for-of exit, then Array.from will
call IteratorClose in the appropriate case.
R=neis
LOG=Y
BUG=v8:4739
Committed: https://crrev.com/defcc6424409856b0a84f7efacd7b21d8c22bfdd
Cr-Commit-Position: refs/heads/master@{#33859}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Use GetIterator #Messages
Total messages: 19 (8 generated)
The CQ bit was checked by littledan@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1686433003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1686433003/1
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
littledan@chromium.org changed reviewers: + cbruni@chromium.org
lgtm, just one comment. https://codereview.chromium.org/1686433003/diff/1/src/js/array.js File src/js/array.js (right): https://codereview.chromium.org/1686433003/diff/1/src/js/array.js#newcode1782 src/js/array.js:1782: { [iteratorSymbol]() { return %_Call(iterable, items) } }) { Is there a good reason for using %_Call(...) instead of GetIterator(items, iterable)? GetIterator gives a better error message in one case.
The CQ bit was checked by littledan@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1686433003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1686433003/20001
https://codereview.chromium.org/1686433003/diff/1/src/js/array.js File src/js/array.js (right): https://codereview.chromium.org/1686433003/diff/1/src/js/array.js#newcode1782 src/js/array.js:1782: { [iteratorSymbol]() { return %_Call(iterable, items) } }) { On 2016/02/10 at 08:38:28, neis wrote: > Is there a good reason for using %_Call(...) instead of GetIterator(items, iterable)? GetIterator gives a better error message in one case. Nope. (I was somehow thinking that it would be redundant to call GetIterator because the for-of loop would call it, but of course that wouldn't fix the error messages.) Changed it to call GetIterator.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by littledan@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from neis@chromium.org Link to the patchset: https://codereview.chromium.org/1686433003/#ps20001 (title: "Use GetIterator")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1686433003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1686433003/20001
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Description was changed from ========== Use a for-of loop in Array.from If Array.from is passed an iterable, then it will copy the contents to the newly created Array (or subclass). The iteration protocol here includes calling IteratorClose if the loop is exited early due to an exception thrown. This patch converts Array.from to use a for-of loop rather than explicitly invoking the iteration protocol so that, when IteratorClose is invoked on early for-of exit, then Array.from will call IteratorClose in the appropriate case. R=neis LOG=Y BUG=v8:4739 ========== to ========== Use a for-of loop in Array.from If Array.from is passed an iterable, then it will copy the contents to the newly created Array (or subclass). The iteration protocol here includes calling IteratorClose if the loop is exited early due to an exception thrown. This patch converts Array.from to use a for-of loop rather than explicitly invoking the iteration protocol so that, when IteratorClose is invoked on early for-of exit, then Array.from will call IteratorClose in the appropriate case. R=neis LOG=Y BUG=v8:4739 Committed: https://crrev.com/defcc6424409856b0a84f7efacd7b21d8c22bfdd Cr-Commit-Position: refs/heads/master@{#33859} ==========
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/defcc6424409856b0a84f7efacd7b21d8c22bfdd Cr-Commit-Position: refs/heads/master@{#33859} |
