diff --git a/test/language/statements/try/12.14.1-1-s.js b/test/language/statements/try/12.14.1-1-s.js deleted file mode 100644 index 688e10439d239fec34031958d9f3974aecec8b6c..0000000000000000000000000000000000000000 --- a/test/language/statements/try/12.14.1-1-s.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 12.14.1-1-s -description: > - Strict Mode - SyntaxError is thrown if a TryStatement with a Catch - occurs within strict code and the Identifier of the Catch - production is eval -flags: [onlyStrict] ----*/ - -assert.throws(SyntaxError, function() { - eval("\ - try {} catch (eval) { }\ - "); -}); diff --git a/test/language/statements/try/12.14.1-1gs.js b/test/language/statements/try/12.14.1-1gs.js deleted file mode 100644 index 036765dd9c3854f86c4718dac360133f6804233e..0000000000000000000000000000000000000000 --- a/test/language/statements/try/12.14.1-1gs.js +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 12.14.1-1gs -description: > - Strict Mode - SyntaxError is thrown if a TryStatement with a Catch - occurs within strict code and the Identifier of the Catch - production is eval -negative: - phase: early - type: SyntaxError -flags: [onlyStrict] ----*/ - -throw "Test262: This statement should not be evaluated."; - -try { } catch (eval) { } diff --git a/test/language/statements/try/12.14.1-2-s.js b/test/language/statements/try/12.14.1-2-s.js deleted file mode 100644 index 7977218340902d3d973ef264360870f070a81d13..0000000000000000000000000000000000000000 --- a/test/language/statements/try/12.14.1-2-s.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 12.14.1-2-s -description: > - Strict Mode - SyntaxError is thrown if a TryStatement with a Catch - occurs within strict code and the Identifier of the Catch - production is arguments -flags: [onlyStrict] ----*/ - -assert.throws(SyntaxError, function() { - eval("\ - try {} catch (arguments) { }\ - "); -}); diff --git a/test/language/statements/try/12.14.1-3-s.js b/test/language/statements/try/12.14.1-3-s.js deleted file mode 100644 index 7223984812aca05889d3108fed959b1c7ed95852..0000000000000000000000000000000000000000 --- a/test/language/statements/try/12.14.1-3-s.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2012 Ecma International. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -es5id: 12.14.1-3-s -description: > - Strict Mode - SyntaxError isn't thrown if a TryStatement with a - Catch occurs within strict code and the Identifier of the Catch - production is EVAL but throws SyntaxError if it is eval -flags: [onlyStrict] ----*/ - -assert.throws(SyntaxError, function() { - eval(" try { \ - throw new Error(\"...\");\ - return false;\ - } catch (EVAL) {\ - try\ - {\ - throw new Error(\"...\");\ - }catch(eval)\ - {\ - return EVAL instanceof Error;\ - }\ - }"); -}); diff --git a/test/language/statements/try/catch-parameter-boundnames-restriction-arguments-eval-throws.js b/test/language/statements/try/catch-parameter-boundnames-restriction-arguments-eval-throws.js new file mode 100644 index 0000000000000000000000000000000000000000..80a49a5b29fbe2cfd82dd2829669f4e689bc6f94 --- /dev/null +++ b/test/language/statements/try/catch-parameter-boundnames-restriction-arguments-eval-throws.js @@ -0,0 +1,13 @@ +// Copyright (c) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-strict-mode-of-ecmascript +description: > + It is a SyntaxError if a CatchParameter occurs within strict mode code and BoundNames of CatchParameter contains either eval or arguments (13.15.1). +flags: [onlyStrict] +---*/ + +assert.throws(SyntaxError, function() { + eval("try {} catch (arguments) { }"); +}); diff --git a/test/language/statements/try/catch-parameter-boundnames-restriction-arguments-negative-early.js b/test/language/statements/try/catch-parameter-boundnames-restriction-arguments-negative-early.js new file mode 100644 index 0000000000000000000000000000000000000000..72dd87f728bfe5c9f802036419822208f8b75a0f --- /dev/null +++ b/test/language/statements/try/catch-parameter-boundnames-restriction-arguments-negative-early.js @@ -0,0 +1,16 @@ +// Copyright (c) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-strict-mode-of-ecmascript +description: > + It is a SyntaxError if a CatchParameter occurs within strict mode code and BoundNames of CatchParameter contains either eval or arguments (13.15.1). +negative: + phase: early + type: SyntaxError +flags: [onlyStrict] +---*/ + +throw "Test262: This statement should not be evaluated."; + +try { } catch (arguments) { } diff --git a/test/language/statements/try/catch-parameter-boundnames-restriction-eval-eval-throws.js b/test/language/statements/try/catch-parameter-boundnames-restriction-eval-eval-throws.js new file mode 100644 index 0000000000000000000000000000000000000000..086ea255bae7d9b6e3bb44fad13bfd06b24b13c0 --- /dev/null +++ b/test/language/statements/try/catch-parameter-boundnames-restriction-eval-eval-throws.js @@ -0,0 +1,13 @@ +// Copyright (c) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-strict-mode-of-ecmascript +description: > + It is a SyntaxError if a CatchParameter occurs within strict mode code and BoundNames of CatchParameter contains either eval or arguments (13.15.1). +flags: [onlyStrict] +---*/ + +assert.throws(SyntaxError, function() { + eval("try {} catch (eval) { }"); +}); diff --git a/test/language/statements/try/catch-parameter-boundnames-restriction-eval-negative-early.js b/test/language/statements/try/catch-parameter-boundnames-restriction-eval-negative-early.js new file mode 100644 index 0000000000000000000000000000000000000000..277fc168098f152c9bcd96a81c9807e5e2e9a8c7 --- /dev/null +++ b/test/language/statements/try/catch-parameter-boundnames-restriction-eval-negative-early.js @@ -0,0 +1,16 @@ +// Copyright (c) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-strict-mode-of-ecmascript +description: > + It is a SyntaxError if a CatchParameter occurs within strict mode code and BoundNames of CatchParameter contains either eval or arguments (13.15.1). +negative: + phase: early + type: SyntaxError +flags: [onlyStrict] +---*/ + +throw "Test262: This statement should not be evaluated."; + +try { } catch (eval) { }