diff --git a/test/language/statements/function/13.0-17-s.js b/test/language/statements/function/13.0-17-s.js index c269a7b24a..592a633899 100644 --- a/test/language/statements/function/13.0-17-s.js +++ b/test/language/statements/function/13.0-17-s.js @@ -11,12 +11,6 @@ description: > when a Function constructor is contained in strict mode code within eval code flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - eval("'use strict'; var _13_0_17_fun = new Function('eval = 42;'); _13_0_17_fun();"); - return true; - } -runTestCase(testcase); diff --git a/test/language/statements/function/13.0-8-s.js b/test/language/statements/function/13.0-8-s.js index ab970edc62..237812ae7b 100644 --- a/test/language/statements/function/13.0-8-s.js +++ b/test/language/statements/function/13.0-8-s.js @@ -10,19 +10,10 @@ description: > Strict Mode - SourceElements is evaluated as strict mode code when the code of this FunctionExpression is contained in non-strict mode but the call to eval is a direct call in strict mode code -flags: [noStrict] -includes: [runTestCase.js] +flags: [onlyStrict] ---*/ -function testcase() { - "use strict"; - - try { +assert.throws(SyntaxError, function() { eval("var _13_0_8_fun = function () {eval = 42;};"); _13_0_8_fun(); - return false; - } catch (e) { - return e instanceof SyntaxError; - } - } -runTestCase(testcase); +}); diff --git a/test/language/statements/function/13.1-1-1.js b/test/language/statements/function/13.1-1-1.js index c634a7c39b..fe491ee044 100644 --- a/test/language/statements/function/13.1-1-1.js +++ b/test/language/statements/function/13.1-1-1.js @@ -6,17 +6,7 @@ es5id: 13.1-1-1 description: > Duplicate identifier allowed in non-strict function declaration parameter list -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() -{ - try - { eval('function foo(a,a){}'); - return true; - } - catch (e) { return false } - } -runTestCase(testcase); diff --git a/test/language/statements/function/13.1-1-2.js b/test/language/statements/function/13.1-1-2.js index 1fc7af5e71..0db6d3ba79 100644 --- a/test/language/statements/function/13.1-1-2.js +++ b/test/language/statements/function/13.1-1-2.js @@ -6,17 +6,7 @@ es5id: 13.1-1-2 description: > Duplicate identifier allowed in non-strict function expression parameter list -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() -{ - try - { eval('(function foo(a,a){})'); - return true; - } - catch (e) { return false } - } -runTestCase(testcase); diff --git a/test/language/statements/function/13.1-2-1.js b/test/language/statements/function/13.1-2-1.js index 58ed04fb3c..c517620a92 100644 --- a/test/language/statements/function/13.1-2-1.js +++ b/test/language/statements/function/13.1-2-1.js @@ -6,17 +6,7 @@ es5id: 13.1-2-1 description: > eval allowed as formal parameter name of a non-strict function declaration -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() -{ - try - { eval("function foo(eval){};"); - return true; - } - catch (e) { } - } -runTestCase(testcase); diff --git a/test/language/statements/function/13.1-2-5.js b/test/language/statements/function/13.1-2-5.js index 7f70415854..7d7f9cd00d 100644 --- a/test/language/statements/function/13.1-2-5.js +++ b/test/language/statements/function/13.1-2-5.js @@ -6,17 +6,7 @@ es5id: 13.1-2-5 description: > arguments allowed as formal parameter name of a non-strict function declaration -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() -{ - try - { eval("function foo(arguments){};"); - return true; - } - catch (e) { } - } -runTestCase(testcase); diff --git a/test/language/statements/function/13.1-2-6.js b/test/language/statements/function/13.1-2-6.js index c3436c7865..8db8bf9b22 100644 --- a/test/language/statements/function/13.1-2-6.js +++ b/test/language/statements/function/13.1-2-6.js @@ -6,13 +6,7 @@ es5id: 13.1-2-6 description: > arguments allowed as formal parameter name of a non-strict function expression -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() -{ eval("(function foo(arguments){});"); - return true; - } -runTestCase(testcase); diff --git a/test/language/statements/function/13.1-3-1.js b/test/language/statements/function/13.1-3-1.js index 10a8e46611..fa2f589833 100644 --- a/test/language/statements/function/13.1-3-1.js +++ b/test/language/statements/function/13.1-3-1.js @@ -6,17 +6,7 @@ es5id: 13.1-3-1 description: > eval allowed as function identifier in non-strict function declaration -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() -{ - try - { eval("function eval(){};"); - return true; - } - catch (e) { } - } -runTestCase(testcase); diff --git a/test/language/statements/function/13.1-3-2.js b/test/language/statements/function/13.1-3-2.js index 80db21eb33..d3b2f6bf72 100644 --- a/test/language/statements/function/13.1-3-2.js +++ b/test/language/statements/function/13.1-3-2.js @@ -6,17 +6,7 @@ es5id: 13.1-3-2 description: > eval allowed as function identifier in non-strict function expression -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() -{ - try - { eval("(function eval(){});"); - return true; - } - catch (e) { } - } -runTestCase(testcase); diff --git a/test/language/statements/function/13.1-3-7.js b/test/language/statements/function/13.1-3-7.js index c230719b84..e9445cfd80 100644 --- a/test/language/statements/function/13.1-3-7.js +++ b/test/language/statements/function/13.1-3-7.js @@ -6,17 +6,7 @@ es5id: 13.1-3-7 description: > arguments allowed as function identifier in non-strict function declaration -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() -{ - try - { eval("function arguments (){};"); - return true; - } - catch (e) { } - } -runTestCase(testcase); diff --git a/test/language/statements/function/13.1-3-8.js b/test/language/statements/function/13.1-3-8.js index 5734df8e8c..6e2d9e0ba6 100644 --- a/test/language/statements/function/13.1-3-8.js +++ b/test/language/statements/function/13.1-3-8.js @@ -6,17 +6,7 @@ es5id: 13.1-3-8 description: > arguments allowed as function identifier in non-strict function expression -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() -{ - try - { eval("(function arguments (){});"); - return true; - } - catch (e) { } - } -runTestCase(testcase); diff --git a/test/language/statements/function/13.2-11-s.js b/test/language/statements/function/13.2-11-s.js index 5fa605c3e9..4dd684fb47 100644 --- a/test/language/statements/function/13.2-11-s.js +++ b/test/language/statements/function/13.2-11-s.js @@ -6,17 +6,10 @@ es5id: 13.2-11-s description: > StrictMode - enumerating over a function object looking for 'caller' fails outside of the function -includes: [runTestCase.js] ---*/ -function testcase() { var foo = Function("'use strict';"); for (var tempIndex in foo) { - if (tempIndex === "caller") { - return false; - } + assert.notSameValue(tempIndex, "caller", 'tempIndex'); } - return true; -} -runTestCase(testcase); diff --git a/test/language/statements/function/13.2-12-s.js b/test/language/statements/function/13.2-12-s.js index 9c4f397cb6..f276fe4f19 100644 --- a/test/language/statements/function/13.2-12-s.js +++ b/test/language/statements/function/13.2-12-s.js @@ -6,11 +6,7 @@ es5id: 13.2-12-s description: > StrictMode - enumerating over a function object looking for 'caller' fails inside the function -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = Function("'use strict'; for (var tempIndex in this) {if (tempIndex===\"caller\") {return false;}}; return true;"); - return foo.call(foo); -} -runTestCase(testcase); + var foo = Function("'use strict'; for (var tempIndex in this) {assert.notSameValue(tempIndex, 'caller', 'tempIndex');}"); + foo.call(foo); diff --git a/test/language/statements/function/13.2-15-s.js b/test/language/statements/function/13.2-15-s.js index 1f46d30a0c..20b043739f 100644 --- a/test/language/statements/function/13.2-15-s.js +++ b/test/language/statements/function/13.2-15-s.js @@ -6,17 +6,10 @@ es5id: 13.2-15-s description: > StrictMode - enumerating over a function object looking for 'arguments' fails outside of the function -includes: [runTestCase.js] ---*/ -function testcase() { var foo = new Function("'use strict';"); for (var tempIndex in foo) { - if (tempIndex === "arguments") { - return false; - } + assert.notSameValue(tempIndex, "arguments", 'tempIndex'); } - return true; -} -runTestCase(testcase); diff --git a/test/language/statements/function/13.2-16-s.js b/test/language/statements/function/13.2-16-s.js index 159d49a763..acab7f68ed 100644 --- a/test/language/statements/function/13.2-16-s.js +++ b/test/language/statements/function/13.2-16-s.js @@ -6,11 +6,7 @@ es5id: 13.2-16-s description: > StrictMode - enumerating over a function object looking for 'arguments' fails inside the function -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = new Function("'use strict'; for (var tempIndex in this) {if (tempIndex===\"arguments\") {return false;}}; return true;"); - return foo.call(foo); -} -runTestCase(testcase); + var foo = new Function("'use strict'; for (var tempIndex in this) {assert.notSameValue(tempIndex, 'arguments', 'tempIndex');}"); + foo.call(foo); diff --git a/test/language/statements/function/13.2-19-s.js b/test/language/statements/function/13.2-19-s.js index 2f7f47642b..eacfa417e6 100644 --- a/test/language/statements/function/13.2-19-s.js +++ b/test/language/statements/function/13.2-19-s.js @@ -6,17 +6,10 @@ es5id: 13.2-19-s description: > StrictMode - enumerating over a function object looking for 'arguments' fails outside of the function -includes: [runTestCase.js] ---*/ -function testcase() { var foo = Function("'use strict';"); for (var tempIndex in foo) { - if (tempIndex === "arguments") { - return false; - } + assert.notSameValue(tempIndex, "arguments", 'tempIndex'); } - return true; -} -runTestCase(testcase); diff --git a/test/language/statements/function/13.2-20-s.js b/test/language/statements/function/13.2-20-s.js index f7d8d348a4..dac0750292 100644 --- a/test/language/statements/function/13.2-20-s.js +++ b/test/language/statements/function/13.2-20-s.js @@ -7,11 +7,7 @@ description: > StrictMode - enumerating over a function object looking for 'arguments' fails inside the function flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = Function("'use strict'; for (var tempIndex in this) {if (tempIndex===\"arguments\") {return false;}}; return true;"); - return foo.call(foo); -} -runTestCase(testcase); + var foo = Function("'use strict'; for (var tempIndex in this) {assert.notSameValue(tempIndex, 'arguments', 'tempIndex');}"); + foo.call(foo); diff --git a/test/language/statements/function/13.2-23-s.js b/test/language/statements/function/13.2-23-s.js index 7b0b971374..e9df08adf5 100644 --- a/test/language/statements/function/13.2-23-s.js +++ b/test/language/statements/function/13.2-23-s.js @@ -7,16 +7,9 @@ description: > StrictMode - enumerating over a function object looking for 'caller' fails outside of the function flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function foo () {"use strict";} for (var tempIndex in foo) { - if (tempIndex === "caller") { - return false; - } + assert.notSameValue(tempIndex, "caller", 'tempIndex'); } - return true; -} -runTestCase(testcase); diff --git a/test/language/statements/function/13.2-24-s.js b/test/language/statements/function/13.2-24-s.js index 58622c2638..b919eb8278 100644 --- a/test/language/statements/function/13.2-24-s.js +++ b/test/language/statements/function/13.2-24-s.js @@ -7,19 +7,13 @@ description: > StrictMode - enumerating over a function object looking for 'caller' fails inside the function flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function foo () { "use strict"; for (var tempIndex in this) { - if (tempIndex==="caller") { - return false; - } + assert.notSameValue(tempIndex, "caller", 'tempIndex'); } - return true; } - return foo.call(foo); -} -runTestCase(testcase); + +foo.call(foo); diff --git a/test/language/statements/function/13.2-27-s.js b/test/language/statements/function/13.2-27-s.js index 742d5f4460..57080ca624 100644 --- a/test/language/statements/function/13.2-27-s.js +++ b/test/language/statements/function/13.2-27-s.js @@ -7,17 +7,10 @@ description: > StrictMode - enumerating over a function object looking for 'arguments' fails outside of the function flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function foo () {"use strict";} for (var tempIndex in foo) { - if (tempIndex === "arguments") { - return false; - } + assert.notSameValue(tempIndex, "arguments", 'tempIndex'); } - return true; -} -runTestCase(testcase); diff --git a/test/language/statements/function/13.2-28-s.js b/test/language/statements/function/13.2-28-s.js index af65268a80..156fbb7ea5 100644 --- a/test/language/statements/function/13.2-28-s.js +++ b/test/language/statements/function/13.2-28-s.js @@ -7,19 +7,12 @@ description: > StrictMode - enumerating over a function object looking for 'arguments' fails inside the function flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { function foo() { "use strict"; for (var tempIndex in this) { - if (tempIndex==="arguments") { - return false; - } + assert.notSameValue(tempIndex, "arguments", 'tempIndex'); } - return true; } - return foo.call(foo); -} -runTestCase(testcase); + foo.call(foo); diff --git a/test/language/statements/function/13.2-3-s.js b/test/language/statements/function/13.2-3-s.js index e4d6f123b9..3c93a1f65f 100644 --- a/test/language/statements/function/13.2-3-s.js +++ b/test/language/statements/function/13.2-3-s.js @@ -6,14 +6,11 @@ es5id: 13.2-3-s description: > StrictMode - Writing or reading from a property named 'arguments' of function objects is allowed under both strict and normal modes. -includes: [runTestCase.js] ---*/ -function testcase() { var foo = function () { this.arguments = 12; } var obj = new foo(); - return obj.arguments === 12; - } -runTestCase(testcase); + +assert.sameValue(obj.arguments, 12, 'obj.arguments'); diff --git a/test/language/statements/function/13.2-7-s.js b/test/language/statements/function/13.2-7-s.js index c3110ba79d..d91c4f01a5 100644 --- a/test/language/statements/function/13.2-7-s.js +++ b/test/language/statements/function/13.2-7-s.js @@ -7,17 +7,10 @@ description: > StrictMode - enumerating over a function object looking for 'caller' fails outside of the function flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { var foo = new Function("'use strict';"); for (var tempIndex in foo) { - if (tempIndex === "caller") { - return false; - } + assert.notSameValue(tempIndex, "caller", 'tempIndex'); } - return true; - } -runTestCase(testcase); diff --git a/test/language/statements/function/13.2-8-s.js b/test/language/statements/function/13.2-8-s.js index c6c3da8aa1..a297ab7952 100644 --- a/test/language/statements/function/13.2-8-s.js +++ b/test/language/statements/function/13.2-8-s.js @@ -7,11 +7,7 @@ description: > StrictMode - enumerating over a function object looking for 'caller' fails inside the function flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - var foo = new Function("'use strict'; for (var tempIndex in this) {if (tempIndex===\"caller\") {return false;}}; return true;"); - return foo.call(foo); - } -runTestCase(testcase); + var foo = new Function("'use strict'; for (var tempIndex in this) {assert.notSameValue(tempIndex, 'caller', 'tempIndex');}"); + foo.call(foo); diff --git a/test/language/statements/try/12.14-1.js b/test/language/statements/try/12.14-1.js index 76ce1dc32d..c7c8bf2f8c 100644 --- a/test/language/statements/try/12.14-1.js +++ b/test/language/statements/try/12.14-1.js @@ -7,10 +7,8 @@ description: > catch doesn't change declaration scope - var initializer in catch with same name as catch parameter changes parameter features: [AnnexB] -includes: [runTestCase.js] ---*/ -function testcase() { foo = "prior to throw"; try { throw new Error(); @@ -18,7 +16,5 @@ function testcase() { catch (foo) { var foo = "initializer in catch"; } - return foo === "prior to throw"; - - } -runTestCase(testcase); + +assert.sameValue(foo, "prior to throw"); diff --git a/test/language/statements/try/12.14-10.js b/test/language/statements/try/12.14-10.js index 01c7c9f41a..d3720bfc15 100644 --- a/test/language/statements/try/12.14-10.js +++ b/test/language/statements/try/12.14-10.js @@ -4,10 +4,8 @@ /*--- es5id: 12.14-10 description: catch introduces scope - name lookup finds function parameter -includes: [runTestCase.js] ---*/ -function testcase() { function f(o) { function innerf(o, x) { @@ -21,9 +19,5 @@ function testcase() { return innerf(o, 42); } - - if (f({}) === 42) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(f({}), 42); diff --git a/test/language/statements/try/12.14-11.js b/test/language/statements/try/12.14-11.js index 3961ab1039..1671cfe8fb 100644 --- a/test/language/statements/try/12.14-11.js +++ b/test/language/statements/try/12.14-11.js @@ -4,10 +4,8 @@ /*--- es5id: 12.14-11 description: catch introduces scope - name lookup finds inner variable -includes: [runTestCase.js] ---*/ -function testcase() { function f(o) { function innerf(o) { @@ -23,9 +21,5 @@ function testcase() { return innerf(o); } - - if (f({}) === 42) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(f({}), 42); diff --git a/test/language/statements/try/12.14-12.js b/test/language/statements/try/12.14-12.js index 01f2ea64bd..39260df919 100644 --- a/test/language/statements/try/12.14-12.js +++ b/test/language/statements/try/12.14-12.js @@ -4,10 +4,8 @@ /*--- es5id: 12.14-12 description: catch introduces scope - name lookup finds property -includes: [runTestCase.js] ---*/ -function testcase() { function f(o) { function innerf(o) { @@ -21,9 +19,5 @@ function testcase() { return innerf(o); } - - if (f({x:42}) === 42) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(f({x:42}), 42); diff --git a/test/language/statements/try/12.14-2.js b/test/language/statements/try/12.14-2.js index 4bc8dcd8d5..7ddd343aa0 100644 --- a/test/language/statements/try/12.14-2.js +++ b/test/language/statements/try/12.14-2.js @@ -7,10 +7,8 @@ description: > catch doesn't change declaration scope - var initializer in catch with same name as catch parameter changes parameter features: [AnnexB] -includes: [runTestCase.js] ---*/ -function testcase() { function capturedFoo() {return foo}; foo = "prior to throw"; try { @@ -18,8 +16,6 @@ function testcase() { } catch (foo) { var foo = "initializer in catch"; - return capturedFoo() !== "initializer in catch"; } - - } -runTestCase(testcase); + +assert.sameValue(capturedFoo(), "prior to throw"); diff --git a/test/language/statements/try/12.14-3.js b/test/language/statements/try/12.14-3.js index 0ca154a985..37cf6e9d27 100644 --- a/test/language/statements/try/12.14-3.js +++ b/test/language/statements/try/12.14-3.js @@ -14,17 +14,13 @@ es5id: 12.14-3 description: > catch doesn't change declaration scope - var declaration are visible outside when name different from catch parameter -includes: [runTestCase.js] ---*/ -function testcase() { try { throw new Error(); } catch (e) { var foo = "declaration in catch"; } - - return foo === "declaration in catch"; - } -runTestCase(testcase); + +assert.sameValue(foo, "declaration in catch"); diff --git a/test/language/statements/try/12.14-4.js b/test/language/statements/try/12.14-4.js index a55795870a..1ce1900775 100644 --- a/test/language/statements/try/12.14-4.js +++ b/test/language/statements/try/12.14-4.js @@ -12,10 +12,8 @@ info: > eval should use the appended object to the scope chain es5id: 12.14-4 description: catch introduces scope - block-local vars must shadow outer vars -includes: [runTestCase.js] ---*/ -function testcase() { var o = { foo : 42}; try { @@ -23,10 +21,6 @@ function testcase() { } catch (e) { var foo; - - if (foo === undefined) { - return true; - } } - } -runTestCase(testcase); + +assert.sameValue(foo, undefined); diff --git a/test/language/statements/try/12.14-6.js b/test/language/statements/try/12.14-6.js index 8f2a2d5777..43052c9c54 100644 --- a/test/language/statements/try/12.14-6.js +++ b/test/language/statements/try/12.14-6.js @@ -14,10 +14,8 @@ es5id: 12.14-6 description: > catch introduces scope - block-local function expression must shadow outer function expression -includes: [runTestCase.js] ---*/ -function testcase() { var o = {foo : function () { return 42;}}; try { @@ -25,9 +23,6 @@ function testcase() { } catch (e) { var foo = function () {}; - if (foo() === undefined) { - return true; - } } - } -runTestCase(testcase); + +assert.sameValue(foo(), undefined); diff --git a/test/language/statements/try/12.14-7.js b/test/language/statements/try/12.14-7.js index 2f86ec68d4..d8acf17b1f 100644 --- a/test/language/statements/try/12.14-7.js +++ b/test/language/statements/try/12.14-7.js @@ -12,10 +12,8 @@ info: > eval should use the appended object to the scope chain es5id: 12.14-7 description: catch introduces scope - scope removed when exiting catch block -includes: [runTestCase.js] ---*/ -function testcase() { var o = {foo: 1}; var catchAccessed = false; @@ -25,13 +23,14 @@ function testcase() { catch (expObj) { catchAccessed = (expObj.foo == 1); } + assert(catchAccessed, '(expObj.foo == 1)'); + + catchAccessed = false; try { expObj; } catch (e) { - return catchAccessed && e instanceof ReferenceError + catchAccessed = e instanceof ReferenceError } - return false; - } -runTestCase(testcase); + assert(catchAccessed, 'e instanceof ReferenceError'); diff --git a/test/language/statements/try/12.14-8.js b/test/language/statements/try/12.14-8.js index 1fe9ae1cad..16986ef685 100644 --- a/test/language/statements/try/12.14-8.js +++ b/test/language/statements/try/12.14-8.js @@ -14,10 +14,8 @@ es5id: 12.14-8 description: > catch introduces scope - scope removed when exiting catch block (properties) -includes: [runTestCase.js] ---*/ -function testcase() { var o = {foo: 42}; try { @@ -27,8 +25,4 @@ function testcase() { var foo = 1; } - if (o.foo === 42) { - return true; - } - } -runTestCase(testcase); +assert.sameValue(o.foo, 42); diff --git a/test/language/statements/try/12.14-9.js b/test/language/statements/try/12.14-9.js index 7e129581cb..d2ee163843 100644 --- a/test/language/statements/try/12.14-9.js +++ b/test/language/statements/try/12.14-9.js @@ -4,10 +4,8 @@ /*--- es5id: 12.14-9 description: catch introduces scope - name lookup finds outer variable -includes: [runTestCase.js] ---*/ -function testcase() { function f(o) { var x = 42; @@ -22,9 +20,5 @@ function testcase() { return innerf(o); } - - if (f({}) === 42) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(f({}), 42); diff --git a/test/language/statements/try/12.14.1-4-s.js b/test/language/statements/try/12.14.1-4-s.js index f035689c17..b9d306e9cb 100644 --- a/test/language/statements/try/12.14.1-4-s.js +++ b/test/language/statements/try/12.14.1-4-s.js @@ -7,15 +7,14 @@ description: > Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is EVAL -includes: [runTestCase.js] ---*/ -function testcase() { +var isInstance = false; + try { throw new Error("..."); - return false; } catch (EVAL) { - return EVAL instanceof Error; + isInstance = EVAL instanceof Error; } - } -runTestCase(testcase); + +assert(isInstance); diff --git a/test/language/statements/try/12.14.1-5-s.js b/test/language/statements/try/12.14.1-5-s.js index c29979d3fb..e589e635b1 100644 --- a/test/language/statements/try/12.14.1-5-s.js +++ b/test/language/statements/try/12.14.1-5-s.js @@ -7,15 +7,14 @@ description: > Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is Arguments -includes: [runTestCase.js] ---*/ -function testcase() { +var isInstance = false; + try { throw new Error("..."); - return false; } catch (Arguments) { - return Arguments instanceof Error; + isInstance = Arguments instanceof Error; } - } -runTestCase(testcase); + +assert(isInstance); diff --git a/test/language/statements/try/12.14.1-6-s.js b/test/language/statements/try/12.14.1-6-s.js index afa0e7134f..ccade6497d 100644 --- a/test/language/statements/try/12.14.1-6-s.js +++ b/test/language/statements/try/12.14.1-6-s.js @@ -7,15 +7,14 @@ description: > Strict Mode - SyntaxError isn't thrown if a TryStatement with a Catch occurs within strict code and the Identifier of the Catch production is ARGUMENTS -includes: [runTestCase.js] ---*/ -function testcase() { +var isInstance = false; + try { throw new Error("..."); - return false; } catch (ARGUMENTS) { - return ARGUMENTS instanceof Error; + isInstance = ARGUMENTS instanceof Error; } - } -runTestCase(testcase); + +assert(isInstance); diff --git a/test/language/statements/variable/12.2.1-11.js b/test/language/statements/variable/12.2.1-11.js index e908dd48a6..5c49b6fe48 100644 --- a/test/language/statements/variable/12.2.1-11.js +++ b/test/language/statements/variable/12.2.1-11.js @@ -4,12 +4,10 @@ /*--- es5id: 12.2.1-11 description: arguments as var identifier in eval code is allowed -includes: [runTestCase.js] flags: [noStrict] ---*/ function testcase() { eval("var arguments;"); - return true; } -runTestCase(testcase); +testcase(); diff --git a/test/language/statements/variable/12.2.1-12.js b/test/language/statements/variable/12.2.1-12.js index a0de7fe046..130ecf0eb6 100644 --- a/test/language/statements/variable/12.2.1-12.js +++ b/test/language/statements/variable/12.2.1-12.js @@ -4,12 +4,7 @@ /*--- es5id: 12.2.1-12 description: arguments as local var identifier is allowed -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() { eval("(function (){var arguments;})"); - return true; - } -runTestCase(testcase); diff --git a/test/language/statements/variable/12.2.1-16-s.js b/test/language/statements/variable/12.2.1-16-s.js index 24e66f1c59..b7579348c1 100644 --- a/test/language/statements/variable/12.2.1-16-s.js +++ b/test/language/statements/variable/12.2.1-16-s.js @@ -6,11 +6,6 @@ es5id: 12.2.1-16-s description: > A Function constructor (called as a function) declaring a var named 'arguments' does not throw a SyntaxError -includes: [runTestCase.js] ---*/ -function testcase() { Function('var arguments;'); - return true; -} -runTestCase(testcase); diff --git a/test/language/statements/variable/12.2.1-17-s.js b/test/language/statements/variable/12.2.1-17-s.js index 9eb870194f..2318ba0de6 100644 --- a/test/language/statements/variable/12.2.1-17-s.js +++ b/test/language/statements/variable/12.2.1-17-s.js @@ -8,12 +8,7 @@ description: > 'arguments' will not throw any error if contained within strict mode and its body does not start with strict mode flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { var f = Function('arguments = 42;'); f(); - return true; -} -runTestCase(testcase); diff --git a/test/language/statements/variable/12.2.1-20-s.js b/test/language/statements/variable/12.2.1-20-s.js index 08c3968833..62d9687056 100644 --- a/test/language/statements/variable/12.2.1-20-s.js +++ b/test/language/statements/variable/12.2.1-20-s.js @@ -6,12 +6,7 @@ es5id: 12.2.1-20-s description: > Strict Mode: an indirect eval declaring a var named 'arguments' does not throw -includes: [runTestCase.js] ---*/ -function testcase() { var s = eval; s('var arguments;'); - return true; -} -runTestCase(testcase); diff --git a/test/language/statements/variable/12.2.1-21-s.js b/test/language/statements/variable/12.2.1-21-s.js index b4baa0e152..05128f037e 100644 --- a/test/language/statements/variable/12.2.1-21-s.js +++ b/test/language/statements/variable/12.2.1-21-s.js @@ -6,12 +6,7 @@ es5id: 12.2.1-21-s description: > Strict Mode: an indirect eval assigning into 'arguments' does not throw -includes: [runTestCase.js] ---*/ -function testcase() { var s = eval; s('arguments = 42;'); - return true; -} -runTestCase(testcase); diff --git a/test/language/statements/variable/12.2.1-9-s.js b/test/language/statements/variable/12.2.1-9-s.js index 9e8fae42cf..d30834bd88 100644 --- a/test/language/statements/variable/12.2.1-9-s.js +++ b/test/language/statements/variable/12.2.1-9-s.js @@ -5,12 +5,7 @@ es5id: 12.2.1-9-s description: > an indirect eval declaring a var named 'eval' does not throw -includes: [runTestCase.js] ---*/ -function testcase() { var s = eval; s('var eval;'); - return true; - } -runTestCase(testcase); diff --git a/test/language/statements/with/12.10-0-10.js b/test/language/statements/with/12.10-0-10.js index 55b8e9620d..759f223480 100644 --- a/test/language/statements/with/12.10-0-10.js +++ b/test/language/statements/with/12.10-0-10.js @@ -4,11 +4,9 @@ /*--- es5id: 12.10-0-10 description: with introduces scope - name lookup finds function parameter -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() { function f(o) { function innerf(o, x) { @@ -19,9 +17,5 @@ function testcase() { return innerf(o, 42); } - - if (f({}) === 42) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(f({}), 42); diff --git a/test/language/statements/with/12.10-0-11.js b/test/language/statements/with/12.10-0-11.js index 689c342bb8..28a1c79ba4 100644 --- a/test/language/statements/with/12.10-0-11.js +++ b/test/language/statements/with/12.10-0-11.js @@ -4,11 +4,9 @@ /*--- es5id: 12.10-0-11 description: with introduces scope - name lookup finds inner variable -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() { function f(o) { function innerf(o) { @@ -21,9 +19,5 @@ function testcase() { return innerf(o); } - - if (f({}) === 42) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(f({}), 42); diff --git a/test/language/statements/with/12.10-0-12.js b/test/language/statements/with/12.10-0-12.js index 605b79f774..324b772afb 100644 --- a/test/language/statements/with/12.10-0-12.js +++ b/test/language/statements/with/12.10-0-12.js @@ -4,11 +4,9 @@ /*--- es5id: 12.10-0-12 description: with introduces scope - name lookup finds property -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() { function f(o) { function innerf(o) { @@ -19,9 +17,5 @@ function testcase() { return innerf(o); } - - if (f({x:42}) === 42) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(f({x:42}), 42); diff --git a/test/language/statements/with/12.10-0-7.js b/test/language/statements/with/12.10-0-7.js index 9d7dbdb298..72e38e9fbb 100644 --- a/test/language/statements/with/12.10-0-7.js +++ b/test/language/statements/with/12.10-0-7.js @@ -4,11 +4,9 @@ /*--- es5id: 12.10-0-7 description: with introduces scope - scope removed when exiting with statement -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() { var o = {foo: 1}; with (o) { @@ -17,9 +15,8 @@ function testcase() { try { foo; + throw new Error(); } catch (e) { - return true; + assert(e instanceof ReferenceError); } - } -runTestCase(testcase); diff --git a/test/language/statements/with/12.10-0-9.js b/test/language/statements/with/12.10-0-9.js index 3e7df5afdb..f18b3798be 100644 --- a/test/language/statements/with/12.10-0-9.js +++ b/test/language/statements/with/12.10-0-9.js @@ -4,11 +4,9 @@ /*--- es5id: 12.10-0-9 description: with introduces scope - name lookup finds outer variable -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() { function f(o) { var x = 42; @@ -20,9 +18,5 @@ function testcase() { return innerf(o); } - - if (f({}) === 42) { - return true; - } - } -runTestCase(testcase); + +assert.sameValue(f({}), 42); diff --git a/test/language/statements/with/12.10-2-1.js b/test/language/statements/with/12.10-2-1.js index 6fd93a0c3d..6b42928ed8 100644 --- a/test/language/statements/with/12.10-2-1.js +++ b/test/language/statements/with/12.10-2-1.js @@ -4,23 +4,13 @@ /*--- es5id: 12.10-2-1 description: with - expression being Number -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() { var o = 2; var foo = 1; - try - { with (o) { foo = 42; } - } - catch(e) - { - } - return true; - - } -runTestCase(testcase); + +assert.sameValue(foo, 42); diff --git a/test/language/statements/with/12.10-2-2.js b/test/language/statements/with/12.10-2-2.js index 2f2a2ae9a8..15635e69e6 100644 --- a/test/language/statements/with/12.10-2-2.js +++ b/test/language/statements/with/12.10-2-2.js @@ -4,23 +4,13 @@ /*--- es5id: 12.10-2-2 description: with - expression being Boolean -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() { var o = true; var foo = 1; - try - { with (o) { foo = 42; } - } - catch(e) - { - } - return true; - - } -runTestCase(testcase); + +assert.sameValue(foo, 42); diff --git a/test/language/statements/with/12.10-2-3.js b/test/language/statements/with/12.10-2-3.js index fd3f6c9b00..4b07ea5d0c 100644 --- a/test/language/statements/with/12.10-2-3.js +++ b/test/language/statements/with/12.10-2-3.js @@ -4,23 +4,13 @@ /*--- es5id: 12.10-2-3 description: with - expression being string -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() { var o = "str"; var foo = 1; - try - { with (o) { foo = 42; } - } - catch(e) - { - } - return true; - - } -runTestCase(testcase); + +assert.sameValue(foo, 42); diff --git a/test/language/statements/with/12.10-7-1.js b/test/language/statements/with/12.10-7-1.js index 5d38a0d0fb..62c1a50489 100644 --- a/test/language/statements/with/12.10-7-1.js +++ b/test/language/statements/with/12.10-7-1.js @@ -4,28 +4,21 @@ /*--- es5id: 12.10-7-1 description: with introduces scope - restores the earlier environment on exit -includes: [runTestCase.js] flags: [noStrict] ---*/ -function testcase() { var a = 1; var o = {a : 2}; - try - { + try { with (o) { a = 3; throw 1; a = 4; } - } - catch(e) - {} - - if (a === 1 && o.a === 3) { - return true; + } catch (e) { + // intentionally ignored } - } -runTestCase(testcase); +assert.sameValue(a, 1, 'a'); +assert.sameValue(o.a, 3, 'o.a'); diff --git a/test/language/statements/with/12.10.1-13-s.js b/test/language/statements/with/12.10.1-13-s.js index 453435feae..78f71260ec 100644 --- a/test/language/statements/with/12.10.1-13-s.js +++ b/test/language/statements/with/12.10.1-13-s.js @@ -7,13 +7,8 @@ description: > Strict Mode - SyntaxError isn't thrown when WithStatement body is in strict mode code flags: [noStrict] -includes: [runTestCase.js] ---*/ -function testcase() { with ({}) { "use strict"; } - return true; - } -runTestCase(testcase); diff --git a/test/language/statements/with/12.10.1-5-s.js b/test/language/statements/with/12.10.1-5-s.js index 9f6a6e4423..955dcaedfe 100644 --- a/test/language/statements/with/12.10.1-5-s.js +++ b/test/language/statements/with/12.10.1-5-s.js @@ -7,13 +7,6 @@ description: > with statement allowed in nested Function even if its container Function is strict) flags: [onlyStrict] -includes: [runTestCase.js] ---*/ -function testcase() { - Function("\'use strict\'; var f1 = Function( \"var o = {}; with (o) {};\")"); - return true; - - } -runTestCase(testcase);