mirror of
https://github.com/tc39/test262.git
synced 2025-07-26 07:25:15 +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
|
es5id: 12.2.1-12
|
||||||
|
esid: sec-variable-statement
|
||||||
description: arguments as local var identifier is allowed
|
description: arguments as local var identifier is allowed
|
||||||
flags: [noStrict]
|
flags: [noStrict]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
eval("(function (){var arguments;})");
|
var arguments;
|
@ -3,13 +3,16 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 12.2.1-28-s
|
es5id: 12.2.1-28-s
|
||||||
|
esid: sec-variable-statement
|
||||||
description: >
|
description: >
|
||||||
arguments as local var identifier assigned to throws SyntaxError
|
arguments as local var identifier assigned to throws SyntaxError
|
||||||
in strict mode
|
in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
var a, arguments = 42;
|
||||||
eval('function foo() { var a, arguments = 42;}');
|
|
||||||
});
|
|
@ -3,11 +3,14 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 12.2.1-30-s
|
es5id: 12.2.1-30-s
|
||||||
|
esid: sec-variable-statement
|
||||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
var a = 42, arguments;
|
||||||
eval('function foo() { var a = 42, arguments;}');
|
|
||||||
});
|
|
@ -3,11 +3,14 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 12.2.1-25-s
|
es5id: 12.2.1-25-s
|
||||||
|
esid: sec-variable-statement
|
||||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
var arguments, a;
|
||||||
eval('function foo() { var arguments, a;}');
|
|
||||||
});
|
|
@ -3,11 +3,14 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 12.2.1-33-s
|
es5id: 12.2.1-33-s
|
||||||
|
esid: sec-variable-statement
|
||||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
var a, arguments, b;
|
||||||
eval('function foo() { var a, arguments, b;}');
|
|
||||||
});
|
|
@ -3,13 +3,16 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 12.2.1-32-s
|
es5id: 12.2.1-32-s
|
||||||
|
esid: sec-variable-statement
|
||||||
description: >
|
description: >
|
||||||
arguments as local var identifier defined twice and assigned once
|
arguments as local var identifier defined twice and assigned once
|
||||||
throws SyntaxError in strict mode
|
throws SyntaxError in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
var arguments, arguments = 42;
|
||||||
eval('function foo() { var arguments, arguments = 42;}');
|
|
||||||
});
|
|
@ -3,13 +3,16 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 12.2.1-23-s
|
es5id: 12.2.1-23-s
|
||||||
|
esid: sec-variable-statement
|
||||||
description: >
|
description: >
|
||||||
arguments as local var identifier assigned to throws SyntaxError
|
arguments as local var identifier assigned to throws SyntaxError
|
||||||
in strict mode
|
in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
var arguments = 42;
|
||||||
eval('function foo() { var arguments = 42;}');
|
|
||||||
});
|
|
@ -3,11 +3,14 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 12.2.1-12-s
|
es5id: 12.2.1-12-s
|
||||||
|
esid: sec-variable-statement
|
||||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
var arguments;
|
||||||
eval('function foo() { var arguments;}');
|
|
||||||
});
|
|
@ -3,11 +3,14 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 12.2.1-26-s
|
es5id: 12.2.1-26-s
|
||||||
|
esid: sec-variable-statement
|
||||||
description: eval as local var identifier throws SyntaxError in strict mode
|
description: eval as local var identifier throws SyntaxError in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
var a, eval;
|
||||||
eval('function foo() { var a, eval;}');
|
|
||||||
});
|
|
@ -3,13 +3,16 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 12.2.1-27-s
|
es5id: 12.2.1-27-s
|
||||||
|
esid: sec-variable-statement
|
||||||
description: >
|
description: >
|
||||||
eval as local var identifier assigned to throws SyntaxError in
|
eval as local var identifier assigned to throws SyntaxError in
|
||||||
strict mode
|
strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
var eval = 42, a;
|
||||||
eval('function foo() { var eval = 42, a;}');
|
|
||||||
});
|
|
@ -3,11 +3,14 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 12.2.1-29-s
|
es5id: 12.2.1-29-s
|
||||||
|
esid: sec-variable-statement
|
||||||
description: eval as local var identifier throws SyntaxError in strict mode
|
description: eval as local var identifier throws SyntaxError in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
var eval, a = 42;
|
||||||
eval('function foo() { var eval, a = 42;}');
|
|
||||||
});
|
|
@ -3,13 +3,16 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 12.2.1-31-s
|
es5id: 12.2.1-31-s
|
||||||
|
esid: sec-variable-statement
|
||||||
description: >
|
description: >
|
||||||
eval as local var identifier defined twice throws SyntaxError in
|
eval as local var identifier defined twice throws SyntaxError in
|
||||||
strict mode
|
strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
var eval, eval;
|
||||||
eval('function foo() { var eval, eval;}');
|
|
||||||
});
|
|
@ -3,13 +3,16 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 12.2.1-24-s
|
es5id: 12.2.1-24-s
|
||||||
|
esid: sec-variable-statement
|
||||||
description: >
|
description: >
|
||||||
eval as local var identifier assigned to throws SyntaxError in
|
eval as local var identifier assigned to throws SyntaxError in
|
||||||
strict mode
|
strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
var eval = 42;
|
||||||
eval('function foo() { var eval = 42;}');
|
|
||||||
});
|
|
@ -3,13 +3,16 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 12.2.1-1-s
|
es5id: 12.2.1-1-s
|
||||||
|
esid: sec-variable-statement
|
||||||
description: >
|
description: >
|
||||||
eval - a function declaring a var named 'eval' throws SyntaxError
|
eval - a function declaring a var named 'eval' throws SyntaxError
|
||||||
in strict mode
|
in strict mode
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
assert.throws(SyntaxError, function() {
|
var eval;
|
||||||
eval('function foo() { var eval; }');
|
|
||||||
});
|
|
Loading…
x
Reference in New Issue
Block a user