Commit 227fd1d4 authored by littledan's avatar littledan Committed by Commit bot

Ship ES2015 iterator finalization

This patch moves iterator finalization (calling .return() when a
for-of loop exits early) to shipping. The only part of this feature
which is currently known to be missing is destructuring--.return()
should be also be called when destructuring with an array which
does not end in a rest pattern, but it currently does not. The rest
of this feature, including calling .return() from certain builtins,
is implemented.

R=adamk
BUG=v8:3566
LOG=Y

Review URL: https://codereview.chromium.org/1738463003

Cr-Commit-Position: refs/heads/master@{#34307}
parent 4da2e3db
......@@ -221,7 +221,6 @@ DEFINE_IMPLICATION(es_staging, harmony_tailcalls)
#define HARMONY_STAGED(V) \
V(harmony_function_name, "harmony Function name inference") \
V(harmony_regexp_lookbehind, "harmony regexp lookbehind") \
V(harmony_iterator_close, "harmony iterator finalization") \
V(harmony_instanceof, "harmony instanceof support")
// Features that are shipping (turned on by default, but internal flag remains).
......@@ -229,6 +228,7 @@ DEFINE_IMPLICATION(es_staging, harmony_tailcalls)
V(harmony_default_parameters, "harmony default parameters") \
V(harmony_destructuring_assignment, "harmony destructuring assignment") \
V(harmony_destructuring_bind, "harmony destructuring bind") \
V(harmony_iterator_close, "harmony iterator finalization") \
V(harmony_tostring, "harmony toString") \
V(harmony_regexps, "harmony regular expression extensions") \
V(harmony_unicode_regexps, "harmony unicode regexps") \
......
......@@ -93,6 +93,10 @@
'test-api/StrongModeAccessCheckAllowed': [FAIL],
'test-api/StrongModeAccessCheckBlocked': [FAIL],
# Iterator finalization was implemented, which changed the bytecode
# generated from for-of loops
'test-bytecode-generator/ForOf': [FAIL],
##############################################################################
# TurboFan compiler failures.
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-do-expressions
// Flags: --harmony-do-expressions --noharmony-iterator-close
(function testWithSimpleLoopVariable() {
var f = (x, y = (do { var s=0; for (var e of x) s += e; s; })) => y*(y+1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment