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}
This commit is contained in:
marja 2016-11-22 07:45:53 -08:00 committed by Commit bot
parent 5ef05d8e2c
commit 0f87349505
4 changed files with 33 additions and 12 deletions

View File

@ -19,3 +19,21 @@ assertThrows("L: L1: L: ;");
assertThrows("function f() { L: L1: L: ; }"); assertThrows("function f() { L: L1: L: ; }");
assertThrows("L: L1: L2: L3: L4: L: ;"); assertThrows("L: L1: L2: L3: L4: L: ;");
assertThrows("function f() { 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);

View File

@ -1082,10 +1082,11 @@
var g21 = ({x}) => { { function x() { return 2 } } return x(); } var g21 = ({x}) => { { function x() { return 2 } } return x(); }
assertThrows(() => g21({x: 1}), TypeError); assertThrows(() => g21({x: 1}), TypeError);
assertThrows("'use strict'; function f(x) { let 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}) { 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'; (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);
assertThrows("'use strict'; let g = ({x}) => { let x = 0; }", SyntaxError); assertThrows("'use strict'; let g = ({x}) => { let x = 0; }", SyntaxError);

View File

@ -51,10 +51,11 @@
function* f21({x}) { { function x() { return 2 } } return x; } function* f21({x}) { { function x() { return 2 } } return x; }
assertEquals(1, f21({x: 1}).next().value); assertEquals(1, f21({x: 1}).next().value);
assertThrows("'use strict'; function* f(x) { let 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}) { 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'; (function* f({x}) { const x = 0; })()", SyntaxError);
}()); }());
(function TestDefaults() { (function TestDefaults() {

View File

@ -151,10 +151,11 @@ function assertEqualsAsync(expected, run, msg) {
var g21 = async ({x}) => { { function x() { return 2 } } return x(); } var g21 = async ({x}) => { { function x() { return 2 } } return x(); }
assertThrowsAsync(() => g21({x: 1}), TypeError); assertThrowsAsync(() => g21({x: 1}), TypeError);
assertThrows("'use strict'; async function f(x) { let 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}) { 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'; (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);
assertThrows("'use strict'; let g = async ({x}) => { let x = 0; }", SyntaxError); assertThrows("'use strict'; let g = async ({x}) => { let x = 0; }", SyntaxError);