diff --git a/test/language/expressions/function/name-arguments-non-strict.js b/test/language/expressions/function/name-arguments-non-strict.js index 6e2d9e0ba617a64d8469836754ccc9ad7451216a..ecfe0b86875654f5d89a4940b0d848733f566e67 100644 --- a/test/language/expressions/function/name-arguments-non-strict.js +++ b/test/language/expressions/function/name-arguments-non-strict.js @@ -9,4 +9,4 @@ description: > flags: [noStrict] ---*/ - eval("(function arguments (){});"); +(function arguments (){}); diff --git a/test/language/expressions/function/name-arguments-strict-body.js b/test/language/expressions/function/name-arguments-strict-body.js index 8e9a3fccb80c0794bb956486969212910c92f0d8..542026bf01e2deab1326b4d24c0bd790b41e3429 100644 --- a/test/language/expressions/function/name-arguments-strict-body.js +++ b/test/language/expressions/function/name-arguments-strict-body.js @@ -7,10 +7,12 @@ description: > StrictMode - SyntaxError is thrown if 'arguments' occurs as the Identifier of a FunctionExpression whose FunctionBody is contained in strict code +negative: + phase: parse + type: SyntaxError flags: [noStrict] ---*/ - var _13_1_42_s = {}; -assert.throws(SyntaxError, function() { - eval("_13_1_42_s.x = function arguments() {'use strict';};"); -}); +throw "Test262: This statement should not be evaluated."; + +(function arguments() {'use strict';}); diff --git a/test/language/expressions/function/name-arguments-strict.js b/test/language/expressions/function/name-arguments-strict.js index 902419038bdfb71a90541aa91e984d5bf806c915..a88dd86db4aa7b363282237f910d785e944151c1 100644 --- a/test/language/expressions/function/name-arguments-strict.js +++ b/test/language/expressions/function/name-arguments-strict.js @@ -6,10 +6,12 @@ es5id: 13.1-14-s description: > StrictMode - SyntaxError is thrown if 'arguments' occurs as the Identifier of a FunctionExpression in strict mode +negative: + phase: parse + type: SyntaxError flags: [onlyStrict] ---*/ - var _13_1_14_s = {}; -assert.throws(SyntaxError, function() { - eval("_13_1_14_s.x = function arguments() {};"); -}); +throw "Test262: This statement should not be evaluated."; + +(function arguments() {}); diff --git a/test/language/expressions/function/name-eval-non-strict.js b/test/language/expressions/function/name-eval-non-strict.js index d3b2f6bf72000e8d7babcf2d625bced626195fe1..0b136c2859c4684a29b2252d11aaf323f502dacc 100644 --- a/test/language/expressions/function/name-eval-non-strict.js +++ b/test/language/expressions/function/name-eval-non-strict.js @@ -9,4 +9,4 @@ description: > flags: [noStrict] ---*/ - eval("(function eval(){});"); +(function eval(){}); diff --git a/test/language/expressions/function/name-eval-strict-body.js b/test/language/expressions/function/name-eval-strict-body.js index ac4db793ddef2f6b14506bb0fbe76b59238e106e..c373e46171cbdc734673066d3e1f88f3484aaba7 100644 --- a/test/language/expressions/function/name-eval-strict-body.js +++ b/test/language/expressions/function/name-eval-strict-body.js @@ -7,10 +7,12 @@ description: > StrictMode - SyntaxError is thrown if 'eval' occurs as the Identifier of a FunctionExpression whose FunctionBody is contained in strict code +negative: + phase: parse + type: SyntaxError flags: [noStrict] ---*/ - var _13_1_38_s = {}; -assert.throws(SyntaxError, function() { - eval("_13_1_38_s.x = function eval() {'use strict'; };"); -}); +throw "Test262: This statement should not be evaluated."; + +(function eval() {'use strict';}); diff --git a/test/language/expressions/function/name-eval-strict.js b/test/language/expressions/function/name-eval-strict.js index 9ab5a3d72769c8684bac882fed0fe9596c92c0c5..d1e81dd1c9782ceea9e2a36b638756224bc63c4d 100644 --- a/test/language/expressions/function/name-eval-strict.js +++ b/test/language/expressions/function/name-eval-strict.js @@ -6,10 +6,12 @@ es5id: 13.1-12-s description: > StrictMode - SyntaxError is thrown if 'eval' occurs as the Identifier of a FunctionExpression in strict mode +negative: + phase: parse + type: SyntaxError flags: [onlyStrict] ---*/ - var _13_1_12_s = {}; -assert.throws(SyntaxError, function() { - eval("_13_1_12_s.x = function eval() {};"); -}); +throw "Test262: This statement should not be evaluated."; + +(function eval() {}); diff --git a/test/language/expressions/function/param-arguments-non-strict.js b/test/language/expressions/function/param-arguments-non-strict.js index 8db8bf9b2296813568fc84982000ee022aff7351..e3a9167fb5d3f994e436981d9fe0846f642bec8f 100644 --- a/test/language/expressions/function/param-arguments-non-strict.js +++ b/test/language/expressions/function/param-arguments-non-strict.js @@ -9,4 +9,4 @@ description: > flags: [noStrict] ---*/ - eval("(function foo(arguments){});"); +(function foo(arguments){}); diff --git a/test/language/expressions/function/param-duplicated-non-strict.js b/test/language/expressions/function/param-duplicated-non-strict.js index 0db6d3ba798d8de09af9da3884279ed397ef9537..a1710392db50f3fbc527716f035cd7ab89928927 100644 --- a/test/language/expressions/function/param-duplicated-non-strict.js +++ b/test/language/expressions/function/param-duplicated-non-strict.js @@ -9,4 +9,4 @@ description: > flags: [noStrict] ---*/ - eval('(function foo(a,a){})'); +(function foo(a,a){}); diff --git a/test/language/expressions/function/param-duplicated-strict-1.js b/test/language/expressions/function/param-duplicated-strict-1.js index 3f38c146aac955f58ceadf95f1c807c9a12c7ffe..a1233a6956960a03c5fe0872fa61e2d2418eef26 100644 --- a/test/language/expressions/function/param-duplicated-strict-1.js +++ b/test/language/expressions/function/param-duplicated-strict-1.js @@ -11,10 +11,12 @@ description: > Strict Mode - SyntaxError is thrown if a function is created in 'strict mode' using a FunctionExpression and the function has two identical parameters +negative: + phase: parse + type: SyntaxError flags: [onlyStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("var _13_1_8_fun = function (param, param) { };"); -}); +(function (param, param) { }); diff --git a/test/language/expressions/function/param-duplicated-strict-2.js b/test/language/expressions/function/param-duplicated-strict-2.js index b107b8623848db17f9ac0355e3da41ae01bc5313..c4bd88ffc6f6be62757ff0ec28356a7bc6309239 100644 --- a/test/language/expressions/function/param-duplicated-strict-2.js +++ b/test/language/expressions/function/param-duplicated-strict-2.js @@ -12,10 +12,12 @@ description: > 'strict mode' using a FunctionExpression and the function has two identical parameters, which are separated by a unique parameter name +negative: + phase: parse + type: SyntaxError flags: [onlyStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("var _13_1_9_fun = function (param1, param2, param1) { };"); -}); +(function (param1, param2, param1) { }); diff --git a/test/language/expressions/function/param-duplicated-strict-3.js b/test/language/expressions/function/param-duplicated-strict-3.js index c744d7ad8dbd96378b8828875c196df5f163f0fe..0f8b4df2e8f02a9263598f7573f4f4b92b683eb4 100644 --- a/test/language/expressions/function/param-duplicated-strict-3.js +++ b/test/language/expressions/function/param-duplicated-strict-3.js @@ -11,10 +11,12 @@ description: > Strict Mode - SyntaxError is thrown if a function is created in 'strict mode' using a FunctionExpression and the function has three identical parameters +negative: + phase: parse + type: SyntaxError flags: [onlyStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("var _13_1_10_fun = function (param, param, param) { };") -}); +(function (param, param, param) { }); diff --git a/test/language/expressions/function/param-duplicated-strict-body-1.js b/test/language/expressions/function/param-duplicated-strict-body-1.js index 3434df2d15949ac4f18ae3831ce79adaf2a899b5..08c11c65c51970ab0269c7c79bd4bfb16b421829 100644 --- a/test/language/expressions/function/param-duplicated-strict-body-1.js +++ b/test/language/expressions/function/param-duplicated-strict-body-1.js @@ -11,10 +11,12 @@ description: > Strict Mode - SyntaxError is thrown if a function is created using a FunctionExpression whose FunctionBody is contained in strict code and the function has two identical parameters +negative: + phase: parse + type: SyntaxError flags: [noStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("var _13_1_30_fun = function (param, param) { 'use strict'; };"); -}); +(function (param, param) { 'use strict'; }); diff --git a/test/language/expressions/function/param-duplicated-strict-body-2.js b/test/language/expressions/function/param-duplicated-strict-body-2.js index e7ff3ebca13d78b4bb47d91c9febfec713703f70..5d286c9c7f7905e98014e3d241642122da44f25a 100644 --- a/test/language/expressions/function/param-duplicated-strict-body-2.js +++ b/test/language/expressions/function/param-duplicated-strict-body-2.js @@ -12,10 +12,12 @@ description: > a FunctionExpression whose FunctionBody is strict and the function has two identical parameters, which are separated by a unique parameter name +negative: + phase: parse + type: SyntaxError flags: [noStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("var _13_1_32_fun = function (param1, param2, param1) { 'use strict'; };"); -}); +(function (param1, param2, param1) { 'use strict'; }); diff --git a/test/language/expressions/function/param-duplicated-strict-body-3.js b/test/language/expressions/function/param-duplicated-strict-body-3.js index a4d45d00cc0a43bef8bbfc6faf889494259ea323..27807ffaf7c45afb5ad5c68fd8babf45fea2f56e 100644 --- a/test/language/expressions/function/param-duplicated-strict-body-3.js +++ b/test/language/expressions/function/param-duplicated-strict-body-3.js @@ -10,10 +10,12 @@ es5id: 13.1-34-s description: > Strict Mode - SyntaxError is thrown if a function declaration has three identical parameters with a strict mode body +negative: + phase: parse + type: SyntaxError flags: [noStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("var _13_1_34_fun = function (param, param, param) { 'use strict'; };") -}); +(function (param, param, param) { 'use strict'; }); diff --git a/test/language/expressions/function/param-eval-non-strict.js b/test/language/expressions/function/param-eval-non-strict.js index c3e856734fd55f6ffc5d5ad65e53db68cc8141e4..29161ccf091754d8ed209f20764b25ca80718708 100644 --- a/test/language/expressions/function/param-eval-non-strict.js +++ b/test/language/expressions/function/param-eval-non-strict.js @@ -9,4 +9,4 @@ description: > flags: [noStrict] ---*/ - eval("(function foo(eval){});"); +(function foo(eval){}); diff --git a/test/language/expressions/function/param-eval-strict-body.js b/test/language/expressions/function/param-eval-strict-body.js index a3df9f85c8df5883c97793bf210fa83b0f04786f..8b237ad0556195471c750373409ca147486ac738 100644 --- a/test/language/expressions/function/param-eval-strict-body.js +++ b/test/language/expressions/function/param-eval-strict-body.js @@ -11,10 +11,12 @@ description: > StrictMode - SyntaxError is thrown if the identifier 'eval' appears within a FormalParameterList of a strict mode FunctionExpression when FuctionBody is strict code +negative: + phase: parse + type: SyntaxError flags: [noStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("var _13_1_18_fun = function (eval) { 'use strict'; }"); -}); +(function (eval) { 'use strict'; }); diff --git a/test/language/statements/function/enable-strict-via-body.js b/test/language/statements/function/enable-strict-via-body.js index b476325727bbafeada65af3f12044687450eafb6..5a7a830be28ddc0cbd7b4df8e21902c3773df174 100644 --- a/test/language/statements/function/enable-strict-via-body.js +++ b/test/language/statements/function/enable-strict-via-body.js @@ -10,16 +10,17 @@ description: > Strict Mode - SourceElements is evaluated as strict mode code when the code of this FunctionBody with an inner function contains a Use Strict Directive +negative: + phase: parse + type: SyntaxError flags: [noStrict] ---*/ - function _13_0_10_fun() { - function _13_0_10_inner() { - "use strict"; - eval("eval = 42;"); - } - _13_0_10_inner(); - }; -assert.throws(SyntaxError, function() { - _13_0_10_fun(); -}); +throw "Test262: This statement should not be evaluated."; + +function _13_0_10_fun() { + function _13_0_10_inner() { + "use strict"; + eval = 42; + } +} diff --git a/test/language/statements/function/enable-strict-via-outer-body.js b/test/language/statements/function/enable-strict-via-outer-body.js index 393033ff1363805be9556858db8111bf53c54434..efd168aa467d669c8b60f54be998809d7ef4ae0b 100644 --- a/test/language/statements/function/enable-strict-via-outer-body.js +++ b/test/language/statements/function/enable-strict-via-outer-body.js @@ -10,16 +10,17 @@ description: > Strict Mode - SourceElements is evaluated as strict mode code when the code of this FunctionBody with an inner function which is in strict mode +negative: + phase: parse + type: SyntaxError flags: [noStrict] ---*/ - function _13_0_11_fun() { - "use strict"; - function _13_0_11_inner() { - eval("eval = 42;"); - } - _13_0_11_inner(); - }; -assert.throws(SyntaxError, function() { - _13_0_11_fun(); -}); +throw "Test262: This statement should not be evaluated."; + +function _13_0_11_fun() { + "use strict"; + function _13_0_11_inner() { + eval = 42; + } +} diff --git a/test/language/statements/function/enable-strict-via-outer-script.js b/test/language/statements/function/enable-strict-via-outer-script.js index da2066e98909925a161d5d553bb42138c3d5e91a..f2f01d1e2960f75c6f7686ed2d824a51b9744379 100644 --- a/test/language/statements/function/enable-strict-via-outer-script.js +++ b/test/language/statements/function/enable-strict-via-outer-script.js @@ -10,13 +10,16 @@ description: > Strict Mode - SourceElements is evaluated as strict mode code when a FunctionDeclaration that is contained in strict mode code has an inner function +negative: + phase: parse + type: SyntaxError flags: [onlyStrict] ---*/ - var _13_0_9_fun = function () { - function _13_0_9_inner() { eval("eval = 42;"); } - _13_0_9_inner(); - }; -assert.throws(SyntaxError, function() { - _13_0_9_fun(); -}); +throw "Test262: This statement should not be evaluated."; + +var _13_0_9_fun = function () { + function _13_0_9_inner() { + eval = 42; + } +}; diff --git a/test/language/statements/function/invalid-2-names.js b/test/language/statements/function/invalid-2-names.js index 33b5fd66e84d0e06049f5503c681a976e6431347..f7af44a7213bcc70678b58cd07bd93ee8de9938c 100644 --- a/test/language/statements/function/invalid-2-names.js +++ b/test/language/statements/function/invalid-2-names.js @@ -6,9 +6,11 @@ es5id: 13.0-1 description: > 13.0 - multiple names in one function declaration is not allowed, two function names +negative: + phase: parse + type: SyntaxError ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function x, y() {}"); -}); +function x, y() {} diff --git a/test/language/statements/function/invalid-3-names.js b/test/language/statements/function/invalid-3-names.js index 7a3712f061c747daeea46ae2ab4433280bfd8fe5..4d19df15de3c89e2f6e2e9949d7d1ce1d2cbca5c 100644 --- a/test/language/statements/function/invalid-3-names.js +++ b/test/language/statements/function/invalid-3-names.js @@ -6,9 +6,11 @@ es5id: 13.0-2 description: > 13.0 - multiple names in one function declaration is not allowed, three function names +negative: + phase: parse + type: SyntaxError ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function x,y,z(){}"); -}); +function x,y,z(){} diff --git a/test/language/statements/function/invalid-function-body-1.js b/test/language/statements/function/invalid-function-body-1.js new file mode 100644 index 0000000000000000000000000000000000000000..9888d4d8f524eed5744f4095b7e62eb6158213eb --- /dev/null +++ b/test/language/statements/function/invalid-function-body-1.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The FunctionBody must be SourceElements +es5id: 13_A7_T2 +description: > + Inserting elements that is different from SourceElements into the + FunctionBody +negative: + phase: parse + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +function __func(){/ ABC} diff --git a/test/language/statements/function/invalid-function-body-2.js b/test/language/statements/function/invalid-function-body-2.js new file mode 100644 index 0000000000000000000000000000000000000000..bbd8c93ec86fe0c37b15c2e37871af3ddce1f805 --- /dev/null +++ b/test/language/statements/function/invalid-function-body-2.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The FunctionBody must be SourceElements +es5id: 13_A7_T2 +description: > + Inserting elements that is different from SourceElements into the + FunctionBody +negative: + phase: parse + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +function __func(){&1} diff --git a/test/language/statements/function/invalid-function-body-3.js b/test/language/statements/function/invalid-function-body-3.js new file mode 100644 index 0000000000000000000000000000000000000000..6087c3ac0d9c9225795ed6064119423ad100c558 --- /dev/null +++ b/test/language/statements/function/invalid-function-body-3.js @@ -0,0 +1,17 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: The FunctionBody must be SourceElements +es5id: 13_A7_T2 +description: > + Inserting elements that is different from SourceElements into the + FunctionBody +negative: + phase: parse + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +function __func(){# ABC} diff --git a/test/language/statements/function/invalid-function-body.js b/test/language/statements/function/invalid-function-body.js deleted file mode 100644 index b4ed77cab58d0291c4da2cb3a4a91064e499550b..0000000000000000000000000000000000000000 --- a/test/language/statements/function/invalid-function-body.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: The FunctionBody must be SourceElements -es5id: 13_A7_T2 -description: > - Inserting elements that is different from SourceElements into the - FunctionBody ----*/ - -////////////////////////////////////////////////////////////////////////////// -//CHECK#1 -try{ - eval("function __func(){/ ABC}"); - $ERROR('#1: eval("function __func(){/ ABC}") lead to throwing exception'); -} catch(e){ - if(!(e instanceof SyntaxError)){ - $ERROR('#1.1: eval("function __func(){/ ABC}") lead to throwing exception of SyntaxError. Actual: exception is '+e); - } -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#3 -try{ - eval("function __func(){&1}"); - $ERROR('#3: eval("function __func(){&1}") lead to throwing exception'); -} catch(e){ - if(!(e instanceof SyntaxError)){ - $ERROR('#3.1: eval("function __func(){&1}") lead to throwing exception of SyntaxError. Actual: exception is '+e); - } -} -// -////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////////////////////////////////////////////////// -//CHECK#4 -try{ - eval("function __func(){# ABC}"); - $ERROR('#4: eval("function __func(){# ABC}") lead to throwing exception'); -} catch(e){ - if(!(e instanceof SyntaxError)){ - $ERROR('#4.1: eval("function __func(){# ABC}") lead to throwing exception of SyntaxError. Actual: exception is '+e); - } -} -// -////////////////////////////////////////////////////////////////////////////// diff --git a/test/language/statements/function/invalid-name-dot.js b/test/language/statements/function/invalid-name-dot.js index f4eab6a1c8b8819b5c064f0046d2017489fbb2b8..7fa20cd00feafc0299f046d32fabcb3952768354 100644 --- a/test/language/statements/function/invalid-name-dot.js +++ b/test/language/statements/function/invalid-name-dot.js @@ -6,9 +6,11 @@ es5id: 13.0-3 description: > 13.0 - property names in function definition is not allowed, add a new property into object +negative: + phase: parse + type: SyntaxError ---*/ - var obj = {}; -assert.throws(SyntaxError, function() { - eval("function obj.tt() {};"); -}); +throw "Test262: This statement should not be evaluated."; + +function obj.tt() {} diff --git a/test/language/statements/function/invalid-name-two-dots.js b/test/language/statements/function/invalid-name-two-dots.js index ace2f52e131e7ead1ad23588bf456548a7e0f045..b8b9eb62c99d5ec01e6e5955f7c51afc71b1ed0e 100644 --- a/test/language/statements/function/invalid-name-two-dots.js +++ b/test/language/statements/function/invalid-name-two-dots.js @@ -6,10 +6,11 @@ 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 +negative: + phase: parse + type: SyntaxError ---*/ - var obj = {}; - obj.tt = { len: 10 }; -assert.throws(SyntaxError, function() { - eval("function obj.tt.ss() {};"); -}); +throw "Test262: This statement should not be evaluated."; + +function obj.tt.ss() {} diff --git a/test/language/statements/function/line-terminator-non-strict.js b/test/language/statements/function/line-terminator-non-strict.js index 11dba26c68b7e8965216c5acc8c4c952c0e8c37e..d585e3fce24b3bf489676c03d845bfe8b647ebf7 100644 --- a/test/language/statements/function/line-terminator-non-strict.js +++ b/test/language/statements/function/line-terminator-non-strict.js @@ -38,6 +38,12 @@ z z(); -eval("function\u0009\u2029w(\u000C)\u00A0{\u000D};"); +// The following function expression is expressed with literal unicode +// characters so that parsers may benefit from this test. The included code +// points are as follows: +// +// "function\u0009\u2029w(\u000C)\u00A0{\u000D}" + +function 
w() { } w(); diff --git a/test/language/statements/function/line-terminator-strict.js b/test/language/statements/function/line-terminator-strict.js index 00fbf5995e4578e4ac0584345615e5cc25b131ff..3a00e1821aa3d220d2c0df32d575399b291f5155 100644 --- a/test/language/statements/function/line-terminator-strict.js +++ b/test/language/statements/function/line-terminator-strict.js @@ -37,4 +37,12 @@ z z(); -eval("function\u0009\u2029w(\u000C)\u00A0{\u000D}; w()"); +// The following function expression is expressed with literal unicode +// characters so that parsers may benefit from this test. The included code +// points are as follows: +// +// "function\u0009\u2029w(\u000C)\u00A0{\u000D}" + +function 
w() { } + +w(); diff --git a/test/language/statements/function/name-arguments-non-strict.js b/test/language/statements/function/name-arguments-non-strict.js index e9445cfd807530032162c81cf4829c58c76ffb43..8027c96266c1b620b464004e9c3d9e7548378e92 100644 --- a/test/language/statements/function/name-arguments-non-strict.js +++ b/test/language/statements/function/name-arguments-non-strict.js @@ -9,4 +9,4 @@ description: > flags: [noStrict] ---*/ - eval("function arguments (){};"); +function arguments (){} diff --git a/test/language/statements/function/name-arguments-strict-body.js b/test/language/statements/function/name-arguments-strict-body.js index 8c77046075104706bb33379a7b012ea6566f828b..9b13ce5cc4f418298ebe24df5d35f429cd311d5c 100644 --- a/test/language/statements/function/name-arguments-strict-body.js +++ b/test/language/statements/function/name-arguments-strict-body.js @@ -7,10 +7,12 @@ description: > StrictMode - SyntaxError is thrown if 'arguments' occurs as the Identifier of a FunctionDeclaration whose FunctionBody is contained in strict code +negative: + phase: parse + type: SyntaxError flags: [noStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function arguments() { 'use strict'; };") -}); +function arguments() { 'use strict'; } diff --git a/test/language/statements/function/name-arguments-strict.js b/test/language/statements/function/name-arguments-strict.js index ca4217170489b89667ea67c6e193295f3467e9b0..7b6f9bd5aff598536d2023cac4ae68eb8117d209 100644 --- a/test/language/statements/function/name-arguments-strict.js +++ b/test/language/statements/function/name-arguments-strict.js @@ -6,10 +6,12 @@ es5id: 13.1-13-s description: > StrictMode - SyntaxError is thrown if 'arguments' occurs as the function name of a FunctionDeclaration in strict mode +negative: + phase: parse + type: SyntaxError flags: [onlyStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function arguments() { };") -}); +function arguments() { } diff --git a/test/language/statements/function/name-eval-non-strict.js b/test/language/statements/function/name-eval-non-strict.js index fa2f589833f9e719c21c135db912fa0497f1dab6..0206d33bf54eff8ca2df3f2aaf3ba8561bd19588 100644 --- a/test/language/statements/function/name-eval-non-strict.js +++ b/test/language/statements/function/name-eval-non-strict.js @@ -9,4 +9,4 @@ description: > flags: [noStrict] ---*/ - eval("function eval(){};"); +function eval(){} diff --git a/test/language/statements/function/name-eval-strict-body.js b/test/language/statements/function/name-eval-strict-body.js index ce5c98ec0d880b12f4708613de503042b82df124..a11eea2256f0ad7040df5c7ff0dc8f8e5d67aabb 100644 --- a/test/language/statements/function/name-eval-strict-body.js +++ b/test/language/statements/function/name-eval-strict-body.js @@ -7,10 +7,12 @@ description: > StrictMode - SyntaxError is thrown if 'eval' occurs as the function name of a FunctionDeclaration whose FunctionBody is in strict mode +negative: + phase: parse + type: SyntaxError flags: [noStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function eval() { 'use strict'; };") -}); +function eval() { 'use strict'; } diff --git a/test/language/statements/function/name-eval-strict.js b/test/language/statements/function/name-eval-strict.js index f518e3e3ec61762fd94744040dd9e1318d15ece5..a490c39ea0b0a4aa7d4298605c6691c92dc4bb2e 100644 --- a/test/language/statements/function/name-eval-strict.js +++ b/test/language/statements/function/name-eval-strict.js @@ -6,10 +6,12 @@ es5id: 13.1-11-s description: > StrictMode - SyntaxError is thrown if 'eval' occurs as the function name of a FunctionDeclaration in strict mode +negative: + phase: parse + type: SyntaxError flags: [onlyStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function eval() { };") -}); +function eval() { } diff --git a/test/language/statements/function/param-arguments-non-strict.js b/test/language/statements/function/param-arguments-non-strict.js index 7d7f9cd00d238859d8aa7f106aba7508122cedc3..a65a50e95e7d3c51ffcb6494dcf5b57b477ebcd7 100644 --- a/test/language/statements/function/param-arguments-non-strict.js +++ b/test/language/statements/function/param-arguments-non-strict.js @@ -9,4 +9,4 @@ description: > flags: [noStrict] ---*/ - eval("function foo(arguments){};"); +function foo(arguments){} diff --git a/test/language/statements/function/param-arguments-strict-body.js b/test/language/statements/function/param-arguments-strict-body.js index 6d8b18b2d15e061f87f9f7a4cdd2da1e1ad7f084..5b9d2a1b07c9d4c607922e77b82fe374c5ca9690 100644 --- a/test/language/statements/function/param-arguments-strict-body.js +++ b/test/language/statements/function/param-arguments-strict-body.js @@ -11,10 +11,12 @@ description: > StrictMode - SyntaxError is thrown if the identifier 'arguments' appears within a FormalParameterList of a strict mode FunctionDeclaration when FuctionBody is strict code +negative: + phase: parse + type: SyntaxError flags: [noStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function _13_1_20_fun(arguments) { 'use strict'; }"); -}); +function _13_1_20_fun(arguments) { 'use strict'; } diff --git a/test/language/statements/function/param-arguments-strict.js b/test/language/statements/function/param-arguments-strict.js index cb4c6cebbafe09dcd896821a8ebefd8780e2bbc1..4d37b8e8770123d17d13fc88cebd912e1c950126 100644 --- a/test/language/statements/function/param-arguments-strict.js +++ b/test/language/statements/function/param-arguments-strict.js @@ -11,10 +11,12 @@ description: > Strict Mode - SyntaxError is thrown if the identifier 'arguments' appears within a FormalParameterList of a strict mode FunctionDeclaration +negative: + phase: parse + type: SyntaxError flags: [onlyStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function _13_1_3_fun(arguments) { }"); -}); +function _13_1_3_fun(arguments) { } diff --git a/test/language/statements/function/param-duplicated-non-strict.js b/test/language/statements/function/param-duplicated-non-strict.js index fe491ee0447717f744b809cab87ba97290745db9..0f8da7bc21c28b0d46cb704c36d64f6cebe4ceab 100644 --- a/test/language/statements/function/param-duplicated-non-strict.js +++ b/test/language/statements/function/param-duplicated-non-strict.js @@ -9,4 +9,4 @@ description: > flags: [noStrict] ---*/ - eval('function foo(a,a){}'); +function foo(a,a){} diff --git a/test/language/statements/function/param-duplicated-strict-1.js b/test/language/statements/function/param-duplicated-strict-1.js index 3f766c6799da3e7d02ec03a506887cbb51b3d066..b133910ed8022adbd3f55a743bc31d19dea33aa2 100644 --- a/test/language/statements/function/param-duplicated-strict-1.js +++ b/test/language/statements/function/param-duplicated-strict-1.js @@ -11,10 +11,12 @@ description: > Strict Mode - SyntaxError is thrown if a function is declared in 'strict mode' using a FunctionDeclaration and the function has two identical parameters +negative: + phase: parse + type: SyntaxError flags: [onlyStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function _13_1_5_fun(param, param) { }"); -}); +function _13_1_5_fun(param, param) { } diff --git a/test/language/statements/function/param-duplicated-strict-2.js b/test/language/statements/function/param-duplicated-strict-2.js index cf5b51d3e9f1bf28a3c9e93ed434b819461940a2..3abd84005bcfad42a2d485ccdc45b0824e79b260 100644 --- a/test/language/statements/function/param-duplicated-strict-2.js +++ b/test/language/statements/function/param-duplicated-strict-2.js @@ -12,10 +12,12 @@ description: > 'strict mode' using a FunctionDeclaration and the function has two identical parameters, which are separated by a unique parameter name +negative: + phase: parse + type: SyntaxError flags: [onlyStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function _13_1_6_fun(param1, param2, param1) { }"); -}); +function _13_1_6_fun(param1, param2, param1) { } diff --git a/test/language/statements/function/param-duplicated-strict-3.js b/test/language/statements/function/param-duplicated-strict-3.js index aefc23a81c5d524d05afa44fc490536997df9b09..bbde6fb5d737f251c7106872bf994ec6a6041363 100644 --- a/test/language/statements/function/param-duplicated-strict-3.js +++ b/test/language/statements/function/param-duplicated-strict-3.js @@ -11,10 +11,12 @@ description: > Strict Mode - SyntaxError is thrown if a function is created in 'strict mode' using a FunctionDeclaration and the function has three identical parameters +negative: + phase: parse + type: SyntaxError flags: [onlyStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function _13_1_7_fun(param, param, param) { }"); -}); +function _13_1_7_fun(param, param, param) { } diff --git a/test/language/statements/function/param-duplicated-strict-body-1.js b/test/language/statements/function/param-duplicated-strict-body-1.js index bfb7fc45be923ab7f2fd66076ee420f0b3870964..fcbba06103d430aea83a2b74db92daf9427c1efc 100644 --- a/test/language/statements/function/param-duplicated-strict-body-1.js +++ b/test/language/statements/function/param-duplicated-strict-body-1.js @@ -11,10 +11,12 @@ description: > Strict Mode - SyntaxError is thrown if a function is created using a FunctionDeclaration whose FunctionBody is contained in strict code and the function has two identical parameters +negative: + phase: parse + type: SyntaxError flags: [noStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function _13_1_24_fun(param, param) { 'use strict'; }"); -}); +function _13_1_24_fun(param, param) { 'use strict'; } diff --git a/test/language/statements/function/param-duplicated-strict-body-2.js b/test/language/statements/function/param-duplicated-strict-body-2.js index bb385da51a85ea98c5a0de84194bd9f40d584310..5266d30aa9e68fb648b3300abcb5e0bf7b20651d 100644 --- a/test/language/statements/function/param-duplicated-strict-body-2.js +++ b/test/language/statements/function/param-duplicated-strict-body-2.js @@ -12,10 +12,12 @@ description: > a FunctionDeclaration whose FunctionBody is contained in strict code and the function has two identical parameters which are separated by a unique parameter name +negative: + phase: parse + type: SyntaxError flags: [noStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function _13_1_26_fun(param1, param2, param1) { 'use strict'; }"); -}); +function _13_1_26_fun(param1, param2, param1) { 'use strict'; } diff --git a/test/language/statements/function/param-duplicated-strict-body-3.js b/test/language/statements/function/param-duplicated-strict-body-3.js index 54760ba6b2d0b48ef98759375e20be25aa40ea96..6783272a156d6dadc69a9a0b6a2e97c2ded25fdb 100644 --- a/test/language/statements/function/param-duplicated-strict-body-3.js +++ b/test/language/statements/function/param-duplicated-strict-body-3.js @@ -11,10 +11,12 @@ description: > Strict Mode - SyntaxError is thrown if a function is created using a FunctionDeclaration whose FunctionBody is contained in strict code and the function has three identical parameters +negative: + phase: parse + type: SyntaxError flags: [noStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function _13_1_28_fun(param, param, param) { 'use strict'; }"); -}); +function _13_1_28_fun(param, param, param) { 'use strict'; } diff --git a/test/language/statements/function/param-eval-non-strict.js b/test/language/statements/function/param-eval-non-strict.js index c517620a923730a3a4361b238c092d3680a4c123..561b853770eda792c19d75d75e0bc4c9ac64c29a 100644 --- a/test/language/statements/function/param-eval-non-strict.js +++ b/test/language/statements/function/param-eval-non-strict.js @@ -9,4 +9,4 @@ description: > flags: [noStrict] ---*/ - eval("function foo(eval){};"); +function foo(eval){}; diff --git a/test/language/statements/function/param-eval-strict-body.js b/test/language/statements/function/param-eval-strict-body.js index 961dea507d4bc5b8b8f7ce6ca95ac8a0f3e3a078..c47006eda9bd47fc3d7b855f6683249b3e9cc385 100644 --- a/test/language/statements/function/param-eval-strict-body.js +++ b/test/language/statements/function/param-eval-strict-body.js @@ -11,10 +11,12 @@ description: > StrictMode - SyntaxError is thrown if the identifier 'eval' appears within a FormalParameterList of a strict mode FunctionDeclaration when FuctionBody is strict code +negative: + phase: parse + type: SyntaxError flags: [noStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function _13_1_16_fun(eval) { 'use strict'; }"); -}); +function _13_1_16_fun(eval) { 'use strict'; } diff --git a/test/language/statements/function/param-eval-strict.js b/test/language/statements/function/param-eval-strict.js index 8f1702734d98075fd6459f7d6491d9228486057d..f3e115f57a7a202050c668a9ff2d71f0e3315c4b 100644 --- a/test/language/statements/function/param-eval-strict.js +++ b/test/language/statements/function/param-eval-strict.js @@ -11,10 +11,12 @@ description: > Strict Mode - SyntaxError is thrown if the identifier 'eval' appears within a FormalParameterList of a strict mode FunctionDeclaration +negative: + phase: parse + type: SyntaxError flags: [onlyStrict] ---*/ +throw "Test262: This statement should not be evaluated."; -assert.throws(SyntaxError, function() { - eval("function _13_1_1_fun(eval) { }"); -}); +function _13_1_1_fun(eval) { }