mirror of https://github.com/tc39/test262.git
Replace runTestCase with assert.throws [test/language/statements]
This commit is contained in:
parent
3de484fe83
commit
7f55f60b5f
|
@ -4,15 +4,9 @@
|
|||
/*---
|
||||
es5id: 12.1-1
|
||||
description: "12.1 - block '{ StatementListopt };' is not allowed: try-catch"
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("try{};catch(){}");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -6,15 +6,9 @@ es5id: 12.1-2
|
|||
description: >
|
||||
12.1 - block '{ StatementListopt };' is not allowed:
|
||||
try-catch-finally
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("try{};catch{};finally{}");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -4,15 +4,9 @@
|
|||
/*---
|
||||
es5id: 12.1-3
|
||||
description: "12.1 - block '{ StatementListopt };' is not allowed: try-finally"
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("try{};finally{}");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -4,15 +4,9 @@
|
|||
/*---
|
||||
es5id: 12.1-4
|
||||
description: "12.1 - block '{ StatementListopt };' is not allowed: if-else"
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("if{};else{}");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -4,15 +4,9 @@
|
|||
/*---
|
||||
es5id: 12.1-5
|
||||
description: "12.1 - block '{ StatementListopt };' is not allowed: if-else-if"
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("if{};else if{}");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -6,15 +6,9 @@ es5id: 12.1-6
|
|||
description: >
|
||||
12.1 - block '{ StatementListopt };' is not allowed:
|
||||
if-else-if-else
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("if{};else if{};else{}");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -4,15 +4,9 @@
|
|||
/*---
|
||||
es5id: 12.1-7
|
||||
description: "12.1 - block '{ StatementListopt };' is not allowed: do-while"
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("do{};while()");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -6,15 +6,9 @@ es5id: 13.0-1
|
|||
description: >
|
||||
13.0 - multiple names in one function declaration is not allowed,
|
||||
two function names
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function x, y() {}");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -11,11 +11,8 @@ description: >
|
|||
the code of this FunctionBody with an inner function contains a
|
||||
Use Strict Directive
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function _13_0_10_fun() {
|
||||
function _13_0_10_inner() {
|
||||
"use strict";
|
||||
|
@ -23,11 +20,6 @@ function testcase() {
|
|||
}
|
||||
_13_0_10_inner();
|
||||
};
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
_13_0_10_fun();
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -11,11 +11,8 @@ description: >
|
|||
the code of this FunctionBody with an inner function which is in
|
||||
strict mode
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
function _13_0_11_fun() {
|
||||
"use strict";
|
||||
function _13_0_11_inner() {
|
||||
|
@ -23,11 +20,6 @@ function testcase() {
|
|||
}
|
||||
_13_0_11_inner();
|
||||
};
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
_13_0_11_fun();
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -11,16 +11,9 @@ description: >
|
|||
the function body of a Function constructor begins with a Strict
|
||||
Directive
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("var _13_0_13_fun = new Function(\" \", \"'use strict'; eval = 42;\"); _13_0_13_fun();");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -11,17 +11,10 @@ description: >
|
|||
the function body of a Function constructor contains a Strict
|
||||
Directive
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
var _13_0_14_fun = new Function(" ", "'use strict'; eval = 42; ");
|
||||
_13_0_14_fun();
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -11,17 +11,10 @@ description: >
|
|||
a FunctionDeclaration is contained in strict mode code within eval
|
||||
code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict'; function _13_0_15_fun() {eval = 42;};");
|
||||
_13_0_15_fun();
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -11,17 +11,10 @@ description: >
|
|||
a FunctionExpression is contained in strict mode code within eval
|
||||
code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict'; var _13_0_16_fun = function () {eval = 42;};");
|
||||
_13_0_16_fun();
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -6,15 +6,9 @@ es5id: 13.0-2
|
|||
description: >
|
||||
13.0 - multiple names in one function declaration is not allowed,
|
||||
three function names
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function x,y,z(){}");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -6,16 +6,9 @@ es5id: 13.0-3
|
|||
description: >
|
||||
13.0 - property names in function definition is not allowed, add a
|
||||
new property into object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = {};
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function obj.tt() {};");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -6,17 +6,10 @@ es5id: 13.0-4
|
|||
description: >
|
||||
13.0 - multiple names in one function declaration is not allowed,
|
||||
add a new property into a property which is a object
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var obj = {};
|
||||
obj.tt = { len: 10 };
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function obj.tt.ss() {};");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -11,17 +11,10 @@ description: >
|
|||
the code of this FunctionDeclaration is contained in non-strict
|
||||
mode but the call to eval is a direct call in strict mode code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict'; function _13_0_7_fun() {eval = 42;};");
|
||||
_13_0_7_fun();
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -11,19 +11,12 @@ description: >
|
|||
a FunctionDeclaration that is contained in strict mode code has an
|
||||
inner function
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _13_0_9_fun = function () {
|
||||
function _13_0_9_inner() { eval("eval = 42;"); }
|
||||
_13_0_9_inner();
|
||||
};
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
_13_0_9_fun();
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,15 +12,9 @@ description: >
|
|||
appears within a FormalParameterList of a strict mode
|
||||
FunctionDeclaration
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function _13_1_1_fun(eval) { }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,15 +12,9 @@ description: >
|
|||
'strict mode' using a FunctionExpression and the function has
|
||||
three identical parameters
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("var _13_1_10_fun = function (param, param, param) { };")
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,15 +7,9 @@ description: >
|
|||
StrictMode - SyntaxError is thrown if 'eval' occurs as the
|
||||
function name of a FunctionDeclaration in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function eval() { };")
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,17 +7,9 @@ description: >
|
|||
StrictMode - SyntaxError is thrown if 'eval' occurs as the
|
||||
Identifier of a FunctionExpression in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _13_1_12_s = {};
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("_13_1_12_s.x = function eval() {};");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,15 +7,9 @@ description: >
|
|||
StrictMode - SyntaxError is thrown if 'arguments' occurs as the
|
||||
function name of a FunctionDeclaration in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function arguments() { };")
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,17 +7,9 @@ description: >
|
|||
StrictMode - SyntaxError is thrown if 'arguments' occurs as the
|
||||
Identifier of a FunctionExpression in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _13_1_14_s = {};
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("_13_1_14_s.x = function arguments() {};");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,16 +12,9 @@ description: >
|
|||
appears within a FormalParameterList of a strict mode
|
||||
FunctionDeclaration in strict eval code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict';function _13_1_15_fun(eval) { }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,16 +12,9 @@ description: >
|
|||
appears within a FormalParameterList of a strict mode
|
||||
FunctionDeclaration when FuctionBody is strict code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function _13_1_16_fun(eval) { 'use strict'; }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,16 +12,9 @@ description: >
|
|||
appears within a FormalParameterList of a strict mode
|
||||
FunctionExpression in strict eval code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict'; var _13_1_17_fun = function (eval) { }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,16 +12,9 @@ description: >
|
|||
appears within a FormalParameterList of a strict mode
|
||||
FunctionExpression when FuctionBody is strict code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("var _13_1_18_fun = function (eval) { 'use strict'; }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,16 +12,9 @@ description: >
|
|||
appears within a FormalParameterList of a strict mode
|
||||
FunctionDeclaration in strict eval code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict';function _13_1_19_fun(arguments) { }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,15 +12,9 @@ description: >
|
|||
appears within a FormalParameterList of a strict mode
|
||||
FunctionExpression
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("var _13_1_2_fun = function (eval) { }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,16 +12,9 @@ description: >
|
|||
appears within a FormalParameterList of a strict mode
|
||||
FunctionDeclaration when FuctionBody is strict code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function _13_1_20_fun(arguments) { 'use strict'; }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,16 +12,9 @@ description: >
|
|||
appears within a FormalParameterList of a strict mode
|
||||
FunctionExpression in strict eval code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict'; var _13_1_21_fun = function (arguments) { }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,16 +12,9 @@ description: >
|
|||
appears within a FormalParameterList of a strict mode
|
||||
FunctionExpression when FuctionBody is strict code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("var _13_1_22_fun = function (arguments) { 'use strict'; }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,16 +12,9 @@ description: >
|
|||
a FunctionDeclaration that is contained in eval strict code and
|
||||
the function has two identical parameters
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict'; function _13_1_23_fun(param, param) { }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,16 +12,9 @@ description: >
|
|||
a FunctionDeclaration whose FunctionBody is contained in strict
|
||||
code and the function has two identical parameters
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function _13_1_24_fun(param, param) { 'use strict'; }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -13,16 +13,9 @@ description: >
|
|||
the function has two identical parameters which are separated by a
|
||||
unique parameter name
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict'; function _13_1_25_fun(param1, param2, param1) { }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -13,16 +13,9 @@ description: >
|
|||
code and the function has two identical parameters which are
|
||||
separated by a unique parameter name
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function _13_1_26_fun(param1, param2, param1) { 'use strict'; }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,16 +12,9 @@ description: >
|
|||
a FunctionDeclaration that is contained in eval strict code and
|
||||
the function has three identical parameters
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict'; function _13_1_27_fun(param, param, param) { }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,17 +12,9 @@ description: >
|
|||
a FunctionDeclaration whose FunctionBody is contained in strict
|
||||
code and the function has three identical parameters
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function _13_1_28_fun(param, param, param) { 'use strict'; }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,16 +12,9 @@ description: >
|
|||
a FunctionExpression that is contained in eval strict code and the
|
||||
function has two identical parameters
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict'; var _13_1_29_fun = function (param, param) { };");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,15 +12,9 @@ description: >
|
|||
appears within a FormalParameterList of a strict mode
|
||||
FunctionDeclaration
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function _13_1_3_fun(arguments) { }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,16 +12,9 @@ description: >
|
|||
a FunctionExpression whose FunctionBody is contained in strict
|
||||
code and the function has two identical parameters
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("var _13_1_30_fun = function (param, param) { 'use strict'; };");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -13,16 +13,9 @@ description: >
|
|||
function has two identical parameters, which are separated by a
|
||||
unique parameter name
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict'; var _13_1_31_fun = function (param1, param2, param1) { };");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -13,16 +13,9 @@ description: >
|
|||
has two identical parameters, which are separated by a unique
|
||||
parameter name
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("var _13_1_32_fun = function (param1, param2, param1) { 'use strict'; };");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,16 +12,9 @@ description: >
|
|||
FunctionExpression that is contained in eval strict code and the
|
||||
function has three identical parameters
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict'; var _13_1_33_fun = function (param, param, param) { };")
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -11,16 +11,9 @@ description: >
|
|||
Strict Mode - SyntaxError is thrown if a function declaration has
|
||||
three identical parameters with a strict mode body
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("var _13_1_34_fun = function (param, param, param) { 'use strict'; };")
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
StrictMode - SyntaxError is thrown if 'eval' occurs as the
|
||||
function name of a FunctionDeclaration in strict eval code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict'; function eval() { };")
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -8,16 +8,9 @@ description: >
|
|||
function name of a FunctionDeclaration whose FunctionBody is in
|
||||
strict mode
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function eval() { 'use strict'; };")
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
StrictMode - SyntaxError is thrown if 'eval' occurs as the
|
||||
Identifier of a FunctionExpression in strict eval code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _13_1_37_s = {};
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict'; _13_1_37_s.x = function eval() {};");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -8,16 +8,9 @@ description: >
|
|||
Identifier of a FunctionExpression whose FunctionBody is contained
|
||||
in strict code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _13_1_38_s = {};
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("_13_1_38_s.x = function eval() {'use strict'; };");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
StrictMode - SyntaxError is thrown if 'arguments' occurs as the
|
||||
function name of a FunctionDeclaration in strict eval code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict'; function arguments() { };")
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,15 +12,9 @@ description: >
|
|||
appears within a FormalParameterList of a strict mode
|
||||
FunctionExpression
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("var _13_1_4_fun = function (arguments) { };");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -8,16 +8,9 @@ description: >
|
|||
Identifier of a FunctionDeclaration whose FunctionBody is
|
||||
contained in strict code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function arguments() { 'use strict'; };")
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
StrictMode - SyntaxError is thrown if 'arguments' occurs as the
|
||||
Identifier of a FunctionExpression in strict eval code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _13_1_41_s = {};
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("'use strict'; _13_1_41_s.x = function arguments() {};");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -8,16 +8,9 @@ description: >
|
|||
Identifier of a FunctionExpression whose FunctionBody is contained
|
||||
in strict code
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var _13_1_42_s = {};
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("_13_1_42_s.x = function arguments() {'use strict';};");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,15 +12,9 @@ description: >
|
|||
'strict mode' using a FunctionDeclaration and the function has two
|
||||
identical parameters
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function _13_1_5_fun(param, param) { }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -13,15 +13,9 @@ description: >
|
|||
identical parameters, which are separated by a unique parameter
|
||||
name
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function _13_1_6_fun(param1, param2, param1) { }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,15 +12,9 @@ description: >
|
|||
'strict mode' using a FunctionDeclaration and the function has
|
||||
three identical parameters
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("function _13_1_7_fun(param, param, param) { }");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -12,15 +12,9 @@ description: >
|
|||
'strict mode' using a FunctionExpression and the function has two
|
||||
identical parameters
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("var _13_1_8_fun = function (param, param) { };");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -13,15 +13,9 @@ description: >
|
|||
identical parameters, which are separated by a unique parameter
|
||||
name
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("var _13_1_9_fun = function (param1, param2, param1) { };");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -6,17 +6,9 @@ es5id: 13.2-10-s
|
|||
description: >
|
||||
StrictMode - writing a property named 'caller' of function objects
|
||||
is not allowed outside the function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var foo = Function("'use strict';");
|
||||
try {
|
||||
assert.throws(TypeError, function() {
|
||||
foo.caller = 41;
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return e instanceof TypeError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -6,17 +6,9 @@ es5id: 13.2-13-s
|
|||
description: >
|
||||
StrictMode - reading a property named 'arguments' of function
|
||||
objects is not allowed outside the function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var foo = new Function("'use strict';");
|
||||
try {
|
||||
assert.throws(TypeError, function() {
|
||||
var temp = foo.arguments;
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return e instanceof TypeError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -6,17 +6,9 @@ es5id: 13.2-14-s
|
|||
description: >
|
||||
StrictMode - writing a property named 'arguments' of function
|
||||
objects is not allowed outside the function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var foo = new Function("'use strict';");
|
||||
try {
|
||||
assert.throws(TypeError, function() {
|
||||
foo.arguments = 41;
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return e instanceof TypeError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -6,17 +6,9 @@ es5id: 13.2-17-s
|
|||
description: >
|
||||
StrictMode - reading a property named 'arguments' of function
|
||||
objects is not allowed outside the function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var foo = Function("'use strict';");
|
||||
try {
|
||||
assert.throws(TypeError, function() {
|
||||
var temp = foo.arguments;
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return e instanceof TypeError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -6,17 +6,9 @@ es5id: 13.2-18-s
|
|||
description: >
|
||||
StrictMode - writing a property named 'arguments' of function
|
||||
objects is not allowed outside the function
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var foo = Function("'use strict';");
|
||||
try {
|
||||
assert.throws(TypeError, function() {
|
||||
foo.arguments = 41;
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return e instanceof TypeError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,17 +7,11 @@ description: >
|
|||
StrictMode - A TypeError is thrown when a strict mode code writes
|
||||
to properties named 'caller' of function instances.
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
var foo = function () {
|
||||
}
|
||||
foo.caller = 20;
|
||||
return false;
|
||||
} catch (ex) {
|
||||
return ex instanceof TypeError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,17 +7,9 @@ description: >
|
|||
StrictMode - reading a property named 'caller' of function objects
|
||||
is not allowed outside the function
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo () {"use strict";}
|
||||
try {
|
||||
assert.throws(TypeError, function() {
|
||||
var temp = foo.caller;
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return e instanceof TypeError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,17 +7,9 @@ description: >
|
|||
StrictMode - writing a property named 'caller' of function objects
|
||||
is not allowed outside the function
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo () {"use strict";}
|
||||
try {
|
||||
assert.throws(TypeError, function() {
|
||||
foo.caller = 41;
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return e instanceof TypeError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,17 +7,9 @@ description: >
|
|||
StrictMode - reading a property named 'arguments' of function
|
||||
objects is not allowed outside the function
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo () {"use strict";}
|
||||
try {
|
||||
assert.throws(TypeError, function() {
|
||||
var temp = foo.arguments;
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return e instanceof TypeError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,17 +7,9 @@ description: >
|
|||
StrictMode - writing a property named 'arguments' of function
|
||||
objects is not allowed outside the function
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
function foo () {"use strict";}
|
||||
try {
|
||||
assert.throws(TypeError, function() {
|
||||
foo.arguments = 41;
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return e instanceof TypeError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,17 +7,11 @@ description: >
|
|||
StrictMode - A TypeError is thrown when a code in strict mode
|
||||
tries to write to 'arguments' of function instances.
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
var foo = function () {
|
||||
}
|
||||
foo.arguments = 20;
|
||||
return false;
|
||||
} catch (ex) {
|
||||
return ex instanceof TypeError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,17 +7,9 @@ description: >
|
|||
StrictMode - reading a property named 'caller' of function objects
|
||||
is not allowed outside the function
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var foo = new Function("'use strict';");
|
||||
try {
|
||||
assert.throws(TypeError, function() {
|
||||
var temp = foo.caller;
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return e instanceof TypeError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,17 +7,9 @@ description: >
|
|||
StrictMode - writing a property named 'caller' of function objects
|
||||
is not allowed outside the function
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var foo = new Function("'use strict';");
|
||||
try {
|
||||
assert.throws(TypeError, function() {
|
||||
foo.caller = 41;
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return e instanceof TypeError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,17 +7,9 @@ description: >
|
|||
StrictMode - reading a property named 'caller' of function objects
|
||||
is not allowed outside the function
|
||||
flags: [noStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var foo = Function("'use strict';");
|
||||
try {
|
||||
assert.throws(TypeError, function() {
|
||||
var temp = foo.caller;
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return e instanceof TypeError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -8,17 +8,10 @@ description: >
|
|||
occurs within strict code and the Identifier of the Catch
|
||||
production is eval
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("\
|
||||
try {} catch (eval) { }\
|
||||
");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -8,17 +8,10 @@ description: >
|
|||
occurs within strict code and the Identifier of the Catch
|
||||
production is arguments
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval("\
|
||||
try {} catch (arguments) { }\
|
||||
");
|
||||
return false;
|
||||
} catch (e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -8,11 +8,10 @@ description: >
|
|||
Catch occurs within strict code and the Identifier of the Catch
|
||||
production is EVAL but throws SyntaxError if it is eval
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try{ eval(" try { \
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval(" try { \
|
||||
throw new Error(\"...\");\
|
||||
return false;\
|
||||
} catch (EVAL) {\
|
||||
|
@ -24,9 +23,4 @@ function testcase() {
|
|||
return EVAL instanceof Error;\
|
||||
}\
|
||||
}");
|
||||
return false;
|
||||
} catch(e) {
|
||||
return e instanceof SyntaxError;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
eval - a function declaring a var named 'eval' throws SyntaxError
|
||||
in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var eval; }');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -5,16 +5,9 @@
|
|||
es5id: 12.2.1-12-s
|
||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var arguments;}');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -5,16 +5,9 @@
|
|||
es5id: 12.2.1-13-s
|
||||
description: arguments assignment throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { arguments = 42; }; foo()');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
arguments - a function expr declaring a var named 'arguments'
|
||||
throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('(function (){var arguments;});');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
arguments - a function expr assigning into 'arguments' throws a
|
||||
SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('(function () {arguments = 42;})()');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
A direct eval declaring a var named 'arguments' throws SyntaxError
|
||||
in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('var arguments;');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
A direct eval assigning into 'arguments' throws SyntaxError in
|
||||
strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('arguments = 42;');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError) ;
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
eval - a function assigning into 'eval' throws SyntaxError in
|
||||
strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { eval = 42; }; foo()');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -6,19 +6,9 @@ es5id: 12.2.1-22-s
|
|||
description: >
|
||||
arguments as global var identifier throws SyntaxError in strict
|
||||
mode
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
|
||||
var indirectEval = eval;
|
||||
|
||||
try {
|
||||
assert.throws(SyntaxError, function() {
|
||||
indirectEval("'use strict'; var arguments;");
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
arguments as local var identifier assigned to throws SyntaxError
|
||||
in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var arguments = 42;}');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
eval as local var identifier assigned to throws SyntaxError in
|
||||
strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var eval = 42;}');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -5,16 +5,9 @@
|
|||
es5id: 12.2.1-25-s
|
||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var arguments, a;}');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -5,16 +5,9 @@
|
|||
es5id: 12.2.1-26-s
|
||||
description: eval as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var a, eval;}');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
eval as local var identifier assigned to throws SyntaxError in
|
||||
strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var eval = 42, a;}');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
arguments as local var identifier assigned to throws SyntaxError
|
||||
in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var a, arguments = 42;}');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -5,16 +5,9 @@
|
|||
es5id: 12.2.1-29-s
|
||||
description: eval as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var eval, a = 42;}');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
eval - a function expr declaring a var named 'eval' throws
|
||||
SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('(function () { var eval; })');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -5,16 +5,9 @@
|
|||
es5id: 12.2.1-30-s
|
||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var a = 42, arguments;}');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
eval as local var identifier defined twice throws SyntaxError in
|
||||
strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var eval, eval;}');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -7,16 +7,9 @@ description: >
|
|||
arguments as local var identifier defined twice and assigned once
|
||||
throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var arguments, arguments = 42;}');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -5,16 +5,9 @@
|
|||
es5id: 12.2.1-33-s
|
||||
description: arguments as local var identifier throws SyntaxError in strict mode
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('function foo() { var a, arguments, b;}');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
|
@ -5,16 +5,9 @@
|
|||
es5id: 12.2.1-34-s
|
||||
description: "'for(var eval in ...) {...}' throws SyntaxError in strict mode"
|
||||
flags: [onlyStrict]
|
||||
includes: [runTestCase.js]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
try {
|
||||
|
||||
assert.throws(SyntaxError, function() {
|
||||
eval('for (var eval in null) {};');
|
||||
return false;
|
||||
}
|
||||
catch (e) {
|
||||
return (e instanceof SyntaxError);
|
||||
}
|
||||
}
|
||||
runTestCase(testcase);
|
||||
});
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue