Commit 9e7793ea authored by rossberg's avatar rossberg Committed by Commit bot

Ship for-in initializer deprecation

R=hablich@chromium.org
BUG=v8:4942
LOG=true

Review-Url: https://codereview.chromium.org/1928513004
Cr-Commit-Position: refs/heads/master@{#35868}
parent 683730b1
......@@ -205,7 +205,6 @@ DEFINE_IMPLICATION(es_staging, move_object_start)
#define HARMONY_STAGED(V) \
V(harmony_regexp_lookbehind, "harmony regexp lookbehind") \
V(harmony_tailcalls, "harmony tail calls") \
V(harmony_for_in, "harmony for-in syntax") \
V(harmony_object_values_entries, "harmony Object.values / Object.entries") \
V(harmony_object_own_property_descriptors, \
"harmony Object.getOwnPropertyDescriptors()") \
......@@ -216,6 +215,7 @@ DEFINE_IMPLICATION(es_staging, move_object_start)
V(harmony_array_prototype_values, "harmony Array.prototype.values") \
V(harmony_function_name, "harmony Function name inference") \
V(harmony_instanceof, "harmony instanceof support") \
V(harmony_for_in, "harmony for-in syntax") \
V(harmony_iterator_close, "harmony iterator finalization") \
V(harmony_unicode_regexps, "harmony unicode regexps") \
V(harmony_regexp_exec, "harmony RegExp exec override behavior") \
......
......@@ -25,6 +25,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Flags: --noharmony-for-in
function props(x) {
var array = [];
for (var p in x) array.push(p);
......
......@@ -466,8 +466,8 @@ PASS Invalid: "for (var a = -6, b in b) break"
PASS Invalid: "function f() { for (var a = -6, b in b) break }"
PASS Invalid: "for (var a, b = 8 in b) break"
PASS Invalid: "function f() { for (var a, b = 8 in b) break }"
PASS Valid: "for (var a = (b in c) in d) break"
PASS Valid: "function f() { for (var a = (b in c) in d) break }"
FAIL Valid: "for (var a = (b in c) in d) break" should NOT throw
FAIL Valid: "function f() { for (var a = (b in c) in d) break }" should NOT throw
PASS Invalid: "for (var a = (b in c in d) break"
PASS Invalid: "function f() { for (var a = (b in c in d) break }"
PASS Invalid: "for (var (a) in b) { }"
......
......@@ -147,7 +147,7 @@ shouldBeTrue("forInVarTest()");
function forInVarInitTest()
{
var a;
for (var a = false in { field: false })
for (var a in { field: false })
function f()
{
return true;
......
......@@ -25,7 +25,7 @@ description(
"This test checks for a couple of specific ways that bugs in toString() round trips have changed the meanings of functions with var declarations inside for loops."
);
function f1() { for (var j = 1 in []) {} }
function f1() { for (var j in []) {} }
var f2 = function () { for (var j = 1; j < 10; ++j) {} }
var f3 = function () { for (j = 1;j < 10; ++j) {} }
var f4 = function () { for (var j;;) {} }
......
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