mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 22:15:24 +02:00
Rename and refactor tests
The tests for the parsing of variable declarations were expressed using eval. This made the tests more complex than necessary and also prevented the tests from providing value to ECMAScript parsers. Remove the use of eval and instead express the expectations with literal source text.
This commit is contained in:
parent
ceb79988ae
commit
6b00c8fbfe
@ -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;
|
@ -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;
|
@ -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;
|
@ -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;
|
@ -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