mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 22:15:24 +02:00
Merge pull request #1840 from jugglinmike/refactor-for-parsers-var
Refactor variable declaration tests for parsers
This commit is contained in:
commit
ecb5fcbe33
@ -0,0 +1,19 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-for-statement
|
||||
description: >
|
||||
'for(var arguments = 42 in ...) {...}' throws SyntaxError in
|
||||
strict mode within a function declaration
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
function f() {
|
||||
for (var arguments = 42 in null) {}
|
||||
}
|
19
test/language/statements/for-in/var-arguments-fn-strict.js
Normal file
19
test/language/statements/for-in/var-arguments-fn-strict.js
Normal file
@ -0,0 +1,19 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-for-statement
|
||||
description: >
|
||||
'for(var arguments in ...) {...}' throws SyntaxError in strict mode within a
|
||||
function declaration
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
function f() {
|
||||
for (var arguments in null) {}
|
||||
}
|
@ -2,14 +2,16 @@
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-37-s
|
||||
esid: sec-for-statement
|
||||
description: >
|
||||
'for(var arguments = 42 in ...) {...}' throws SyntaxError in
|
||||
strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('for (var arguments = 42 in null) {};');
|
||||
});
|
||||
for (var arguments = 42 in null) {}
|
@ -2,12 +2,14 @@
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-36-s
|
||||
esid: sec-for-statement
|
||||
description: "'for(var arguments in ...) {...}' throws SyntaxError in strict mode"
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('for (var arguments in null) {};');
|
||||
});
|
||||
for (var arguments in null) {}
|
@ -2,12 +2,14 @@
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-35-s
|
||||
esid: sec-for-statement
|
||||
description: "'for(var eval = 42 in ...) {...}' throws SyntaxError in strict mode"
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('for (var eval = 42 in null) {};');
|
||||
});
|
||||
for (var eval = 42 in null) {}
|
@ -2,12 +2,14 @@
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-34-s
|
||||
esid: sec-for-statement
|
||||
description: "'for(var eval in ...) {...}' throws SyntaxError in strict mode"
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('for (var eval in null) {};');
|
||||
});
|
||||
for (var eval in null) {}
|
@ -1,13 +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.2.1-13-s
|
||||
description: arguments assignment throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { arguments = 42; }; foo()');
|
||||
});
|
@ -1,15 +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.2.1-14-s
|
||||
description: >
|
||||
arguments - a function expr declaring a var named 'arguments'
|
||||
throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('(function (){var arguments;});');
|
||||
});
|
@ -1,15 +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.2.1-15-s
|
||||
description: >
|
||||
arguments - a function expr assigning into 'arguments' throws a
|
||||
SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('(function () {arguments = 42;})()');
|
||||
});
|
14
test/language/statements/variable/arguments-fn-non-strict.js
Normal file
14
test/language/statements/variable/arguments-fn-non-strict.js
Normal file
@ -0,0 +1,14 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-12
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
arguments as local var identifier is allowed within a function declaration
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
function f() {
|
||||
var arguments;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-28-s
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
arguments as local var identifier assigned to throws SyntaxError
|
||||
in strict mode within a function declaration
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
function f() {
|
||||
var a, arguments = 42;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-30-s
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
arguments as local var identifier throws SyntaxError in strict mode within a
|
||||
function declaration
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
function f() {
|
||||
var a = 42, arguments;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
arguments as local var identifier throws SyntaxError in strict mode within a
|
||||
function declaration
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
function f() {
|
||||
var arguments = 42, a;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-25-s
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
arguments as local var identifier throws SyntaxError in strict mode within a
|
||||
function declaration
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
function f() {
|
||||
var arguments, a;
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
arguments as local var identifier throws SyntaxError in strict mode within a
|
||||
function declaration
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
function f() {
|
||||
var a, arguments = 42, b;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-33-s
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
arguments as local var identifier throws SyntaxError in strict mode within a
|
||||
function declaration
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
function f() {
|
||||
var a, arguments, b;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-32-s
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
arguments as local var identifier defined twice and assigned once
|
||||
throws SyntaxError in strict mode within a function declaration
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
function f() {
|
||||
var arguments, arguments = 42;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-23-s
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
arguments as local var identifier assigned to throws SyntaxError
|
||||
in strict mode within a function declaration
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
function f() {
|
||||
var arguments = 42;
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-12-s
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
arguments as local var identifier throws SyntaxError in strict mode within a
|
||||
function declaration
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
function f() {
|
||||
var arguments;
|
||||
}
|
@ -3,8 +3,9 @@
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-12
|
||||
esid: sec-variable-statement
|
||||
description: arguments as local var identifier is allowed
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
eval("(function (){var arguments;})");
|
||||
var arguments;
|
@ -3,13 +3,16 @@
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-28-s
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
arguments as local var identifier assigned to throws SyntaxError
|
||||
in strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var a, arguments = 42;}');
|
||||
});
|
||||
var a, arguments = 42;
|
@ -3,11 +3,14 @@
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-30-s
|
||||
esid: sec-variable-statement
|
||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var a = 42, arguments;}');
|
||||
});
|
||||
var a = 42, arguments;
|
@ -0,0 +1,15 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-variable-statement
|
||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
var arguments = 42, a;
|
@ -3,11 +3,14 @@
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-25-s
|
||||
esid: sec-variable-statement
|
||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var arguments, a;}');
|
||||
});
|
||||
var arguments, a;
|
@ -0,0 +1,15 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-variable-statement
|
||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
var a, arguments = 42, b;
|
@ -3,11 +3,14 @@
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-33-s
|
||||
esid: sec-variable-statement
|
||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var a, arguments, b;}');
|
||||
});
|
||||
var a, arguments, b;
|
@ -3,13 +3,16 @@
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-32-s
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
arguments as local var identifier defined twice and assigned once
|
||||
throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var arguments, arguments = 42;}');
|
||||
});
|
||||
var arguments, arguments = 42;
|
@ -3,13 +3,16 @@
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-23-s
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
arguments as local var identifier assigned to throws SyntaxError
|
||||
in strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var arguments = 42;}');
|
||||
});
|
||||
var arguments = 42;
|
@ -3,11 +3,14 @@
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-12-s
|
||||
esid: sec-variable-statement
|
||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var arguments;}');
|
||||
});
|
||||
var arguments;
|
10
test/language/statements/variable/eval-non-strict.js
Normal file
10
test/language/statements/variable/eval-non-strict.js
Normal file
@ -0,0 +1,10 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-variable-statement
|
||||
description: arguments as local var identifier is allowed
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
var eval;
|
@ -0,0 +1,15 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-variable-statement
|
||||
description: eval as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
var a, eval = 42;
|
@ -3,11 +3,14 @@
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-26-s
|
||||
esid: sec-variable-statement
|
||||
description: eval as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var a, eval;}');
|
||||
});
|
||||
var a, eval;
|
@ -3,13 +3,16 @@
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-27-s
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
eval as local var identifier assigned to throws SyntaxError in
|
||||
strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var eval = 42, a;}');
|
||||
});
|
||||
var eval = 42, a;
|
@ -3,11 +3,14 @@
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-29-s
|
||||
esid: sec-variable-statement
|
||||
description: eval as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var eval, a = 42;}');
|
||||
});
|
||||
var eval, a = 42;
|
@ -0,0 +1,15 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-variable-statement
|
||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
var a, eval = 42, b;
|
15
test/language/statements/variable/eval-strict-list-middle.js
Normal file
15
test/language/statements/variable/eval-strict-list-middle.js
Normal file
@ -0,0 +1,15 @@
|
||||
// Copyright (c) 2018 Mike Pennisi. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-variable-statement
|
||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
var a, eval, b;
|
@ -3,13 +3,16 @@
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-31-s
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
eval as local var identifier defined twice throws SyntaxError in
|
||||
strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var eval, eval;}');
|
||||
});
|
||||
var eval, eval;
|
@ -3,13 +3,16 @@
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-24-s
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
eval as local var identifier assigned to throws SyntaxError in
|
||||
strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var eval = 42;}');
|
||||
});
|
||||
var eval = 42;
|
@ -3,13 +3,16 @@
|
||||
|
||||
/*---
|
||||
es5id: 12.2.1-1-s
|
||||
esid: sec-variable-statement
|
||||
description: >
|
||||
eval - a function declaring a var named 'eval' throws SyntaxError
|
||||
in strict mode
|
||||
flags: [onlyStrict]
|
||||
negative:
|
||||
phase: parse
|
||||
type: SyntaxError
|
||||
---*/
|
||||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var eval; }');
|
||||
});
|
||||
var eval;
|
Loading…
x
Reference in New Issue
Block a user