mirror of
https://github.com/tc39/test262.git
synced 2025-07-24 22:45:10 +02:00
try/catch: catch parameter bound names clean up (#1172)
This commit is contained in:
parent
1fde1ae287
commit
4f4039f716
@ -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) { }\
|
|
||||||
");
|
|
||||||
});
|
|
@ -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) { }
|
|
@ -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) { }\
|
|
||||||
");
|
|
||||||
});
|
|
@ -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;\
|
|
||||||
}\
|
|
||||||
}");
|
|
||||||
});
|
|
@ -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) { }");
|
||||||
|
});
|
@ -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) { }
|
@ -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) { }");
|
||||||
|
});
|
@ -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) { }
|
Loading…
x
Reference in New Issue
Block a user