Commit 0f873495 authored by marja's avatar marja Committed by Commit bot

Update tests which are now failing with FLAG_lazy_inner_functions.

The tests were relying on early errors which we don't produce since we
now preparse more often.

BUG=v8:2728, v8:5501, v8:5663

Review-Url: https://codereview.chromium.org/2523683002
Cr-Commit-Position: refs/heads/master@{#41189}
parent 5ef05d8e
......@@ -19,3 +19,21 @@ assertThrows("L: L1: L: ;");
assertThrows("function f() { L: L1: L: ; }");
assertThrows("L: L1: L2: L3: L4: L: ;");
assertThrows("function f() { L: L1: L2: L3: L4: L: ; }");
// from test/mjsunit/es6/async-destructuring.js
assertThrows("'use strict'; async function f(x) { let x = 0; }", SyntaxError);
assertThrows("'use strict'; async function f({x}) { let x = 0; }", SyntaxError);
assertThrows("'use strict'; async function f(x) { const x = 0; }", SyntaxError);
assertThrows("'use strict'; async function f({x}) { const x = 0; }", SyntaxError);
// from test/mjsunit/es6/destructuring.js
assertThrows("'use strict'; function f(x) { let x = 0; }", SyntaxError);
assertThrows("'use strict'; function f({x}) { let x = 0; }", SyntaxError);
assertThrows("'use strict'; function f(x) { const x = 0; }", SyntaxError);
assertThrows("'use strict'; function f({x}) { const x = 0; }", SyntaxError);
// from test/mjsunit/es6/generator-destructuring.js
assertThrows("'use strict'; function* f(x) { let x = 0; }", SyntaxError);
assertThrows("'use strict'; function* f({x}) { let x = 0; }", SyntaxError);
assertThrows("'use strict'; function* f(x) { const x = 0; }", SyntaxError);
assertThrows("'use strict'; function* f({x}) { const x = 0; }", SyntaxError);
......@@ -1082,10 +1082,11 @@
var g21 = ({x}) => { { function x() { return 2 } } return x(); }
assertThrows(() => g21({x: 1}), TypeError);
assertThrows("'use strict'; function f(x) { let x = 0; }", SyntaxError);
assertThrows("'use strict'; function f({x}) { let x = 0; }", SyntaxError);
assertThrows("'use strict'; function f(x) { const x = 0; }", SyntaxError);
assertThrows("'use strict'; function f({x}) { const x = 0; }", SyntaxError);
// These errors are not recognized in lazy parsing; see mjsunit/bugs/bug-2728.js
assertThrows("'use strict'; (function f(x) { let x = 0; })()", SyntaxError);
assertThrows("'use strict'; (function f({x}) { let x = 0; })()", SyntaxError);
assertThrows("'use strict'; (function f(x) { const x = 0; })()", SyntaxError);
assertThrows("'use strict'; (function f({x}) { const x = 0; })()", SyntaxError);
assertThrows("'use strict'; let g = (x) => { let x = 0; }", SyntaxError);
assertThrows("'use strict'; let g = ({x}) => { let x = 0; }", SyntaxError);
......
......@@ -51,10 +51,11 @@
function* f21({x}) { { function x() { return 2 } } return x; }
assertEquals(1, f21({x: 1}).next().value);
assertThrows("'use strict'; function* f(x) { let x = 0; }", SyntaxError);
assertThrows("'use strict'; function* f({x}) { let x = 0; }", SyntaxError);
assertThrows("'use strict'; function* f(x) { const x = 0; }", SyntaxError);
assertThrows("'use strict'; function* f({x}) { const x = 0; }", SyntaxError);
// These errors are not recognized in lazy parsing; see mjsunit/bugs/bug-2728.js
assertThrows("'use strict'; (function* f(x) { let x = 0; })()", SyntaxError);
assertThrows("'use strict'; (function* f({x}) { let x = 0; })()", SyntaxError);
assertThrows("'use strict'; (function* f(x) { const x = 0; })()", SyntaxError);
assertThrows("'use strict'; (function* f({x}) { const x = 0; })()", SyntaxError);
}());
(function TestDefaults() {
......
......@@ -151,10 +151,11 @@ function assertEqualsAsync(expected, run, msg) {
var g21 = async ({x}) => { { function x() { return 2 } } return x(); }
assertThrowsAsync(() => g21({x: 1}), TypeError);
assertThrows("'use strict'; async function f(x) { let x = 0; }", SyntaxError);
assertThrows("'use strict'; async function f({x}) { let x = 0; }", SyntaxError);
assertThrows("'use strict'; async function f(x) { const x = 0; }", SyntaxError);
assertThrows("'use strict'; async function f({x}) { const x = 0; }", SyntaxError);
// These errors are not recognized in lazy parsing; see mjsunit/bugs/bug-2728.js
assertThrows("'use strict'; (async function f(x) { let x = 0; })()", SyntaxError);
assertThrows("'use strict'; (async function f({x}) { let x = 0; })()", SyntaxError);
assertThrows("'use strict'; (async function f(x) { const x = 0; })()", SyntaxError);
assertThrows("'use strict'; (async function f({x}) { const x = 0; })()", SyntaxError);
assertThrows("'use strict'; let g = async (x) => { let x = 0; }", SyntaxError);
assertThrows("'use strict'; let g = async ({x}) => { let x = 0; }", SyntaxError);
......
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