Skip to content
Snippets Groups Projects
Commit 4f4039f7 authored by Rick Waldron's avatar Rick Waldron Committed by Leo Balter
Browse files

try/catch: catch parameter bound names clean up (#1172)

parent 1fde1ae2
No related branches found
No related tags found
No related merge requests found
// 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;\
}\
}");
});
// Copyright (c) 2012 Ecma International. All rights reserved. // Copyright (c) 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
es5id: 12.14.1-1-s esid: sec-strict-mode-of-ecmascript
description: > description: >
Strict Mode - SyntaxError is thrown if a TryStatement with a Catch It is a SyntaxError if a CatchParameter occurs within strict mode code and BoundNames of CatchParameter contains either eval or arguments (13.15.1).
occurs within strict code and the Identifier of the Catch
production is eval
flags: [onlyStrict] flags: [onlyStrict]
---*/ ---*/
assert.throws(SyntaxError, function() { assert.throws(SyntaxError, function() {
eval("\ eval("try {} catch (arguments) { }");
try {} catch (eval) { }\
");
}); });
// 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) { }
// Copyright (c) 2012 Ecma International. All rights reserved. // Copyright (c) 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
es5id: 12.14.1-2-s esid: sec-strict-mode-of-ecmascript
description: > description: >
Strict Mode - SyntaxError is thrown if a TryStatement with a Catch It is a SyntaxError if a CatchParameter occurs within strict mode code and BoundNames of CatchParameter contains either eval or arguments (13.15.1).
occurs within strict code and the Identifier of the Catch
production is arguments
flags: [onlyStrict] flags: [onlyStrict]
---*/ ---*/
assert.throws(SyntaxError, function() { assert.throws(SyntaxError, function() {
eval("\ eval("try {} catch (eval) { }");
try {} catch (arguments) { }\
");
}); });
// Copyright (c) 2012 Ecma International. All rights reserved. // Copyright (c) 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
es5id: 12.14.1-1gs esid: sec-strict-mode-of-ecmascript
description: > description: >
Strict Mode - SyntaxError is thrown if a TryStatement with a Catch It is a SyntaxError if a CatchParameter occurs within strict mode code and BoundNames of CatchParameter contains either eval or arguments (13.15.1).
occurs within strict code and the Identifier of the Catch
production is eval
negative: negative:
phase: early phase: early
type: SyntaxError type: SyntaxError
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment