diff --git a/test/language/expressions/postfix-decrement/S11.3.2_A1.1_T1.js b/test/language/expressions/postfix-decrement/S11.3.2_A1.1_T1.js deleted file mode 100644 index 457afcd321..0000000000 --- a/test/language/expressions/postfix-decrement/S11.3.2_A1.1_T1.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Line Terminator between LeftHandSideExpression and "--" is not allowed -es5id: 11.3.2_A1.1_T1 -description: Checking Line Feed ----*/ - -assert.throws(SyntaxError, function() { - eval("var x = 1; x\u000A--"); -}); diff --git a/test/language/expressions/postfix-decrement/S11.3.2_A1.1_T3.js b/test/language/expressions/postfix-decrement/S11.3.2_A1.1_T3.js deleted file mode 100644 index 6ea38029ab..0000000000 --- a/test/language/expressions/postfix-decrement/S11.3.2_A1.1_T3.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Line Terminator between LeftHandSideExpression and "--" is not allowed -es5id: 11.3.2_A1.1_T3 -description: Checking Page separator ----*/ - -assert.throws(SyntaxError, function() { - eval("var x = 1; x\u2028--"); -}); diff --git a/test/language/expressions/postfix-decrement/S11.3.2_A1.2_T1.js b/test/language/expressions/postfix-decrement/S11.3.2_A1.2_T1.js deleted file mode 100644 index 8bedcdfb92..0000000000 --- a/test/language/expressions/postfix-decrement/S11.3.2_A1.2_T1.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: White Space between LeftHandSideExpression and "--" are allowed -es5id: 11.3.2_A1.2_T1 -description: Checking by using eval ----*/ - -//CHECK#1 -if (eval("var x = 0; x\u0009--; x") !== -1) { - $ERROR('#1: var x = 0; x\\u0009--; x === -1. Actual: ' + (x)); -} - -//CHECK#2 -if (eval("var x = 0; x\u000B--; x") !== -1) { - $ERROR('#2: var x = 0; x\\u000B--; x === -1. Actual: ' + (x)); -} - -//CHECK#3 -if (eval("var x = 0; x\u000C--; x") !== -1) { - $ERROR('#3: var x = 0; x\\u000C--; x === -1. Actual: ' + (x)); -} - -//CHECK#4 -if (eval("var x = 0; x\u0020--; x") !== -1) { - $ERROR('#4: var x = 0; x\\u0020--; x === -1. Actual: ' + (x)); -} - -//CHECK#5 -if (eval("var x = 0; x\u00A0--; x") !== -1) { - $ERROR('#5: var x = 0; x\\u00A0--; x === -1. Actual: ' + (x)); -} - -//CHECK#6 -if (eval("var x = 0; x\u0009\u000B\u000C\u0020\u00A0--; x") !== -1) { - $ERROR('#6: var x = 0; x\\u0009\\u000B\\u000C\\u0020\\u00A0--; x === -1. Actual: ' + (x)); -} diff --git a/test/language/expressions/postfix-decrement/11.3.2-2-1-s.js b/test/language/expressions/postfix-decrement/arguments.js similarity index 59% rename from test/language/expressions/postfix-decrement/11.3.2-2-1-s.js rename to test/language/expressions/postfix-decrement/arguments.js index 3058aab950..a75b5cf45e 100644 --- a/test/language/expressions/postfix-decrement/11.3.2-2-1-s.js +++ b/test/language/expressions/postfix-decrement/arguments.js @@ -3,17 +3,16 @@ /*--- es5id: 11.3.2-2-1-s +esid: sec-postfix-decrement-operator description: > Strict Mode - SyntaxError is thrown if the identifier 'arguments' appear as a PostfixExpression(arguments--) flags: [onlyStrict] +negative: + phase: parse + type: SyntaxError ---*/ -function testcase() { - var blah = arguments; - assert.throws(SyntaxError, function() { - eval("arguments--;"); - }); - assert.sameValue(blah, arguments, 'blah'); - } -testcase(); +throw "Test262: This statement should not be evaluated."; + +arguments--; diff --git a/test/language/expressions/postfix-decrement/11.3.2-2-2-s.js b/test/language/expressions/postfix-decrement/eval.js similarity index 67% rename from test/language/expressions/postfix-decrement/11.3.2-2-2-s.js rename to test/language/expressions/postfix-decrement/eval.js index 526318e0e7..56abf2077f 100644 --- a/test/language/expressions/postfix-decrement/11.3.2-2-2-s.js +++ b/test/language/expressions/postfix-decrement/eval.js @@ -3,14 +3,16 @@ /*--- es5id: 11.3.2-2-2-s +esid: sec-postfix-decrement-operator description: > Strict Mode - SyntaxError is thrown if the identifier 'eval' appear as a PostfixExpression(eval--) flags: [onlyStrict] +negative: + phase: parse + type: SyntaxError ---*/ - var blah = eval; -assert.throws(SyntaxError, function() { - eval("eval--;"); -}); -assert.sameValue(blah, eval, 'blah'); +throw "Test262: This statement should not be evaluated."; + +eval--; diff --git a/test/language/expressions/postfix-decrement/S11.3.2_A1.1_T2.js b/test/language/expressions/postfix-decrement/line-terminator-carriage-return.js similarity index 55% rename from test/language/expressions/postfix-decrement/S11.3.2_A1.1_T2.js rename to test/language/expressions/postfix-decrement/line-terminator-carriage-return.js index c34cb927b2..e81dfe3832 100644 --- a/test/language/expressions/postfix-decrement/S11.3.2_A1.1_T2.js +++ b/test/language/expressions/postfix-decrement/line-terminator-carriage-return.js @@ -4,9 +4,14 @@ /*--- info: Line Terminator between LeftHandSideExpression and "--" is not allowed es5id: 11.3.2_A1.1_T2 +esid: sec-postfix-decrement-operator description: Checking Carriage Return +negative: + phase: parse + type: SyntaxError ---*/ -assert.throws(SyntaxError, function() { - eval("var x = 1; x\u000D--"); -}); +throw "Test262: This statement should not be evaluated."; + +x --; +// The preceding line contains an unprintable CARRIAGE RETURN character (U+000D) diff --git a/test/language/expressions/postfix-decrement/line-terminator-line-feed.js b/test/language/expressions/postfix-decrement/line-terminator-line-feed.js new file mode 100644 index 0000000000..a928d0770c --- /dev/null +++ b/test/language/expressions/postfix-decrement/line-terminator-line-feed.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: Line Terminator (LINE FEED) between LeftHandSideExpression and "--" is not allowed +es5id: 11.3.2_A1.1_T1 +esid: sec-postfix-decrement-operator +description: Checking Line Feed +negative: + phase: parse + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +x +--; diff --git a/test/language/expressions/postfix-decrement/S11.3.2_A1.1_T4.js b/test/language/expressions/postfix-decrement/line-terminator-line-separator.js similarity index 50% rename from test/language/expressions/postfix-decrement/S11.3.2_A1.1_T4.js rename to test/language/expressions/postfix-decrement/line-terminator-line-separator.js index e83bfb49fb..c934abb450 100644 --- a/test/language/expressions/postfix-decrement/S11.3.2_A1.1_T4.js +++ b/test/language/expressions/postfix-decrement/line-terminator-line-separator.js @@ -3,10 +3,15 @@ /*--- info: Line Terminator between LeftHandSideExpression and "--" is not allowed -es5id: 11.3.2_A1.1_T4 +es5id: 11.3.2_A1.1_T3 +esid: sec-postfix-decrement-operator description: Checking Line separator +negative: + phase: parse + type: SyntaxError ---*/ -assert.throws(SyntaxError, function() { - eval("var x = 1; x\u2029--"); -}); +throw "Test262: This statement should not be evaluated."; + +x
--; +// The preceding line contains an unprintable LINE SEPARATOR character (U+2028) diff --git a/test/language/expressions/postfix-decrement/line-terminator-paragraph-separator.js b/test/language/expressions/postfix-decrement/line-terminator-paragraph-separator.js new file mode 100644 index 0000000000..a7351a61ad --- /dev/null +++ b/test/language/expressions/postfix-decrement/line-terminator-paragraph-separator.js @@ -0,0 +1,18 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +info: Line Terminator between LeftHandSideExpression and "--" is not allowed +es5id: 11.3.2_A1.1_T4 +esid: sec-postfix-decrement-operator +description: Checking Paragraph separator +negative: + phase: parse + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +x
--; +// The preceding line contains an unprintable PARAGRAPH SEPARATOR character +// (U+2029) diff --git a/test/language/expressions/postfix-decrement/whitespace.js b/test/language/expressions/postfix-decrement/whitespace.js new file mode 100644 index 0000000000..926040b214 --- /dev/null +++ b/test/language/expressions/postfix-decrement/whitespace.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: White Space between LeftHandSideExpression and "--" are allowed +es5id: 11.3.2_A1.2_T1 +esid: sec-postfix-decrement-operator +---*/ + +var x = 0; + +assert.sameValue(x --, 0, 'U+0009 (expression)'); +assert.sameValue(x, -1, 'U+0009 (side effect)'); + +assert.sameValue(x --, -1, 'U+000B (expression)'); +assert.sameValue(x, -2, 'U+000B (side effect)'); + +assert.sameValue(x --, -2, 'U+000C (expression)'); +assert.sameValue(x, -3, 'U+000C (side effect)'); + +assert.sameValue(x --, -3, 'U+0020 (expression)'); +assert.sameValue(x, -4, 'U+0020 (side effect)'); + +assert.sameValue(x --, -4, 'U+00A0 (expression)'); +assert.sameValue(x, -5, 'U+00A0 (side effect)'); + +assert.sameValue(x  --, -5, 'U+0009U+000BU+000CU+0020U+00A0 (expression)'); +assert.sameValue(x, -6, 'U+0009U+000BU+000CU+0020U+00A0 (side effect)'); diff --git a/test/language/expressions/postfix-increment/S11.3.1_A1.1_T3.js b/test/language/expressions/postfix-increment/S11.3.1_A1.1_T3.js deleted file mode 100644 index 01eb922615..0000000000 --- a/test/language/expressions/postfix-increment/S11.3.1_A1.1_T3.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: Line Terminator between LeftHandSideExpression and "++" is not allowed -es5id: 11.3.1_A1.1_T3 -description: Checking Line Seprator ----*/ - -assert.throws(SyntaxError, function() { - eval("var x = 1; x\u2028++"); -}); diff --git a/test/language/expressions/postfix-increment/S11.3.1_A1.2_T1.js b/test/language/expressions/postfix-increment/S11.3.1_A1.2_T1.js deleted file mode 100644 index 7f5470ce83..0000000000 --- a/test/language/expressions/postfix-increment/S11.3.1_A1.2_T1.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: White Space between LeftHandSideExpression and "++" are allowed -es5id: 11.3.1_A1.2_T1 -description: Checking by using eval ----*/ - -//CHECK#1 -if (eval("var x = 0; x\u0009++; x") !== 1) { - $ERROR('#1: var x = 0; x\\u0009++; x === 1. Actual: ' + (x)); -} - -//CHECK#2 -if (eval("var x = 0; x\u000B++; x") !== 1) { - $ERROR('#2: var x = 0; x\\u000B++; x === 1. Actual: ' + (x)); -} - -//CHECK#3 -if (eval("var x = 0; x\u000C++; x") !== 1) { - $ERROR('#3: var x = 0; x\\u000C++; x === 1. Actual: ' + (x)); -} - -//CHECK#4 -if (eval("var x = 0; x\u0020++; x") !== 1) { - $ERROR('#4: var x = 0; x\\u0020++; x === 1. Actual: ' + (x)); -} - -//CHECK#5 -if (eval("var x = 0; x\u00A0++; x") !== 1) { - $ERROR('#5: var x = 0; x\\u00A0++; x === 1. Actual: ' + (x)); -} - -//CHECK#6 -if (eval("var x = 0; x\u0009\u000B\u000C\u0020\u00A0++; x") !== 1) { - $ERROR('#6: var x = 0; x\\u0009\\u000B\\u000C\\u0020\\u00A0++; x === 1. Actual: ' + (x)); -} diff --git a/test/language/expressions/postfix-increment/11.3.1-2-1-s.js b/test/language/expressions/postfix-increment/arguments.js similarity index 59% rename from test/language/expressions/postfix-increment/11.3.1-2-1-s.js rename to test/language/expressions/postfix-increment/arguments.js index 3c5bba388f..fc2a982cae 100644 --- a/test/language/expressions/postfix-increment/11.3.1-2-1-s.js +++ b/test/language/expressions/postfix-increment/arguments.js @@ -3,17 +3,16 @@ /*--- es5id: 11.3.1-2-1-s +esid: postfix-increment-operator description: > Strict Mode - SyntaxError is thrown if the identifier 'arguments' appear as a PostfixExpression(arguments++) flags: [onlyStrict] +negative: + phase: parse + type: SyntaxError ---*/ -function testcase() { - var blah = arguments; - assert.throws(SyntaxError, function() { - eval("arguments++;"); - }); - assert.sameValue(blah, arguments, 'blah'); - } -testcase(); +throw "Test262: This statement should not be evaluated."; + +arguments++; diff --git a/test/language/expressions/postfix-increment/11.3.1-2-2-s.js b/test/language/expressions/postfix-increment/eval.js similarity index 68% rename from test/language/expressions/postfix-increment/11.3.1-2-2-s.js rename to test/language/expressions/postfix-increment/eval.js index 54e117f989..c509cb5799 100644 --- a/test/language/expressions/postfix-increment/11.3.1-2-2-s.js +++ b/test/language/expressions/postfix-increment/eval.js @@ -3,14 +3,16 @@ /*--- es5id: 11.3.1-2-2-s +esid: postfix-increment-operator description: > Strict Mode - SyntaxError is thrown if the identifier 'eval' appear as a PostfixExpression(eval++) flags: [onlyStrict] +negative: + phase: parse + type: SyntaxError ---*/ - var blah = eval; -assert.throws(SyntaxError, function() { - eval("eval++;"); -}); -assert.sameValue(blah, eval, 'blah'); +throw "Test262: This statement should not be evaluated."; + +eval++; diff --git a/test/language/expressions/postfix-increment/S11.3.1_A1.1_T2.js b/test/language/expressions/postfix-increment/line-terminator-carriage-return.js similarity index 55% rename from test/language/expressions/postfix-increment/S11.3.1_A1.1_T2.js rename to test/language/expressions/postfix-increment/line-terminator-carriage-return.js index 58dac29479..dbed76b7db 100644 --- a/test/language/expressions/postfix-increment/S11.3.1_A1.1_T2.js +++ b/test/language/expressions/postfix-increment/line-terminator-carriage-return.js @@ -4,9 +4,14 @@ /*--- info: Line Terminator between LeftHandSideExpression and "++" is not allowed es5id: 11.3.1_A1.1_T2 +esid: postfix-increment-operator description: Carriage Return +negative: + phase: parse + type: SyntaxError ---*/ -assert.throws(SyntaxError, function() { - eval("var x = 1; x\u000D++"); -}); +throw "Test262: This statement should not be evaluated."; + +x ++; +// The preceding line contains an unprintable CARRIAGE RETURN character (U+000D) diff --git a/test/language/expressions/postfix-increment/S11.3.1_A1.1_T1.js b/test/language/expressions/postfix-increment/line-terminator-line-feed.js similarity index 65% rename from test/language/expressions/postfix-increment/S11.3.1_A1.1_T1.js rename to test/language/expressions/postfix-increment/line-terminator-line-feed.js index 9800f7c545..01ed086acd 100644 --- a/test/language/expressions/postfix-increment/S11.3.1_A1.1_T1.js +++ b/test/language/expressions/postfix-increment/line-terminator-line-feed.js @@ -4,9 +4,14 @@ /*--- info: Line Terminator between LeftHandSideExpression and "++" is not allowed es5id: 11.3.1_A1.1_T1 +esid: postfix-increment-operator description: Checking Line Feed +negative: + phase: parse + type: SyntaxError ---*/ -assert.throws(SyntaxError, function() { - eval("var x = 1; x\u000A++"); -}); +throw "Test262: This statement should not be evaluated."; + +x +++; diff --git a/test/language/expressions/postfix-increment/line-terminator-line-separator.js b/test/language/expressions/postfix-increment/line-terminator-line-separator.js new file mode 100644 index 0000000000..1c971848f8 --- /dev/null +++ b/test/language/expressions/postfix-increment/line-terminator-line-separator.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: Line Terminator between LeftHandSideExpression and "++" is not allowed +es5id: 11.3.1_A1.1_T3 +esid: postfix-increment-operator +description: Checking Line Separator +negative: + phase: parse + type: SyntaxError +---*/ + +throw "Test262: This statement should not be evaluated."; + +x
++; +// The preceding line contains an unprintable LINE SEPARATOR character (U+2028) diff --git a/test/language/expressions/postfix-increment/S11.3.1_A1.1_T4.js b/test/language/expressions/postfix-increment/line-terminator-paragraph-separator.js similarity index 55% rename from test/language/expressions/postfix-increment/S11.3.1_A1.1_T4.js rename to test/language/expressions/postfix-increment/line-terminator-paragraph-separator.js index 3e5727708f..2ffe94af63 100644 --- a/test/language/expressions/postfix-increment/S11.3.1_A1.1_T4.js +++ b/test/language/expressions/postfix-increment/line-terminator-paragraph-separator.js @@ -4,9 +4,15 @@ /*--- info: Line Terminator between LeftHandSideExpression and "++" is not allowed es5id: 11.3.1_A1.1_T4 +esid: postfix-increment-operator description: Checking Paragraph separator +negative: + phase: parse + type: SyntaxError ---*/ -assert.throws(SyntaxError, function() { - eval("var x = 1; x\u2029++"); -}); +throw "Test262: This statement should not be evaluated."; + +x
++; +// The preceding line contains an unprintable PARAGRAPH SEPARATOR character +// (U+2029) diff --git a/test/language/expressions/postfix-increment/whitespace.js b/test/language/expressions/postfix-increment/whitespace.js new file mode 100644 index 0000000000..045e5722c8 --- /dev/null +++ b/test/language/expressions/postfix-increment/whitespace.js @@ -0,0 +1,28 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: White Space between LeftHandSideExpression and "++" are allowed +es5id: 11.3.1_A1.2_T1 +esid: postfix-increment-operator +---*/ + +var x = 0; + +assert.sameValue(x ++, 0, 'U+0009 (expression)'); +assert.sameValue(x, 1, 'U+0009 (side effect)'); + +assert.sameValue(x ++, 1, 'U+000B (expression)'); +assert.sameValue(x, 2, 'U+000B (side effect)'); + +assert.sameValue(x ++, 2, 'U+000C (expression)'); +assert.sameValue(x, 3, 'U+000C (side effect)'); + +assert.sameValue(x ++, 3, 'U+0020 (expression)'); +assert.sameValue(x, 4, 'U+0020 (side effect)'); + +assert.sameValue(x ++, 4, 'U+00A0 (expression)'); +assert.sameValue(x, 5, 'U+00A0 (side effect)'); + +assert.sameValue(x  ++, 5, 'U+0009U+000BU+000CU+0020U+00A0 (expression)'); +assert.sameValue(x, 6, 'U+0009U+000BU+000CU+0020U+00A0 (side effect)'); diff --git a/test/language/expressions/prefix-decrement/S11.4.5_A1.js b/test/language/expressions/prefix-decrement/S11.4.5_A1.js deleted file mode 100644 index 0ff067de64..0000000000 --- a/test/language/expressions/prefix-decrement/S11.4.5_A1.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: | - White Space and Line Terminator between "--" and UnaryExpression are - allowed -es5id: 11.4.5_A1 -description: Checking by using eval ----*/ - -//CHECK#1 -if (eval("var x = 1; --\u0009x") !== 0) { - $ERROR('#1: var x = 1; --\\u0009x; x === 0. Actual: ' + (x)); -} - -//CHECK#2 -if (eval("var x = 1; --\u000Bx") !== 0) { - $ERROR('#2: var x = 1; --\\u000Bx; x === 0. Actual: ' + (x)); -} - -//CHECK#3 -if (eval("var x = 1; --\u000Cx") !== 0) { - $ERROR('#3: var x = 1; --\\u000Cx; x === 0. Actual: ' + (x)); -} - -//CHECK#4 -if (eval("var x = 1; --\u0020x") !== 0) { - $ERROR('#4: var x = 1; --\\u0020x; x === 0. Actual: ' + (x)); -} - -//CHECK#5 -if (eval("var x = 1; --\u00A0x") !== 0) { - $ERROR('#5: var x = 1; --\\u00A0x; x === 0. Actual: ' + (x)); -} - -//CHECK#6 -if (eval("var x = 1; --\u000Ax") !== 0) { - $ERROR('#6: var x = 1; --\\u000Ax; x === 0. Actual: ' + (x)); -} - -//CHECK#7 -if (eval("var x = 1; --\u000Dx") !== 0) { - $ERROR('#7: var x = 1; --\\u000Dx; x === 0. Actual: ' + (x)); -} - -//CHECK#8 -if (eval("var x = 1; --\u2028x") !== 0) { - $ERROR('#8: var x = 1; --\\u2028x; x === 0. Actual: ' + (x)); -} - -//CHECK#9 -if (eval("var x = 1; --\u2029x") !== 0) { - $ERROR('#9: var x = 1; --\\u2029x; x === 0. Actual: ' + (x)); -} - -//CHECK#10 -if (eval("var x = 1; --\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029x") !== 0) { - $ERROR('#10: var x = 1; --\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029x; x === 0. Actual: ' + (x)); -} diff --git a/test/language/expressions/prefix-decrement/11.4.5-2-2-s.js b/test/language/expressions/prefix-decrement/arguments.js similarity index 54% rename from test/language/expressions/prefix-decrement/11.4.5-2-2-s.js rename to test/language/expressions/prefix-decrement/arguments.js index 1f0786c67a..47fbb66e34 100644 --- a/test/language/expressions/prefix-decrement/11.4.5-2-2-s.js +++ b/test/language/expressions/prefix-decrement/arguments.js @@ -3,15 +3,14 @@ /*--- es5id: 11.4.5-2-2-s +esid: sec-prefix-decrement-operator description: Strict Mode - SyntaxError is thrown for --arguments flags: [onlyStrict] +negative: + phase: parse + type: SyntaxError ---*/ -function testcase() { - var blah = arguments; - assert.throws(SyntaxError, function() { - eval("--arguments;"); - }); - assert.sameValue(blah, arguments, 'blah'); - } -testcase(); +throw "Test262: This statement should not be evaluated."; + +--arguments; diff --git a/test/language/expressions/prefix-decrement/11.4.5-2-1-s.js b/test/language/expressions/prefix-decrement/eval.js similarity index 62% rename from test/language/expressions/prefix-decrement/11.4.5-2-1-s.js rename to test/language/expressions/prefix-decrement/eval.js index 5c1058187d..22998ad514 100644 --- a/test/language/expressions/prefix-decrement/11.4.5-2-1-s.js +++ b/test/language/expressions/prefix-decrement/eval.js @@ -3,12 +3,14 @@ /*--- es5id: 11.4.5-2-1-s +esid: sec-prefix-decrement-operator description: Strict Mode - SyntaxError is thrown for --eval flags: [onlyStrict] +negative: + phase: parse + type: SyntaxError ---*/ - var blah = eval; -assert.throws(SyntaxError, function() { - eval("--eval;"); -}); -assert.sameValue(blah, eval, 'blah'); +throw "Test262: This statement should not be evaluated."; + +--eval; diff --git a/test/language/expressions/prefix-decrement/whitespace.js b/test/language/expressions/prefix-decrement/whitespace.js new file mode 100644 index 0000000000..97f1ae4a67 --- /dev/null +++ b/test/language/expressions/prefix-decrement/whitespace.js @@ -0,0 +1,50 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + White Space and Line Terminator between "--" and UnaryExpression are + allowed +es5id: 11.4.5_A1 +esid: sec-prefix-decrement-operator +---*/ + +var x = 0; + +assert.sameValue(-- x, -1, 'U+0009 (expression)'); +assert.sameValue(x, -1, 'U+0009 (side effect)'); + +assert.sameValue(-- x, -2, 'U+000B (expression)'); +assert.sameValue(x, -2, 'U+000B (side effect)'); + +assert.sameValue(-- x, -3, 'U+000C (expression)'); +assert.sameValue(x, -3, 'U+000C (side effect)'); + +assert.sameValue(-- x, -4, 'U+0020 (expression)'); +assert.sameValue(x, -4, 'U+0020 (side effect)'); + +assert.sameValue(-- x, -5, 'U+00A0 (expression)'); +assert.sameValue(x, -5, 'U+00A0 (side effect)'); + +assert.sameValue(-- +x, -6, 'U+000A (expression)'); +assert.sameValue(x, -6, 'U+000A (side effect)'); + +assert.sameValue(-- x, -7, 'U+000D (expression)'); +assert.sameValue(x, -7, 'U+000D (side effect)'); + +assert.sameValue(--
x, -8, 'U+2028 (expression)'); +assert.sameValue(x, -8, 'U+2028 (side effect)'); + +assert.sameValue(--
x, -9, 'U+2029 (expression)'); +assert.sameValue(x, -9, 'U+2029 (side effect)'); + +assert.sameValue( + --   + 

x, + -10, + 'U+0009U+000BU+000CU+0020U+00A0U+000AU+000DU+2028U+2029 (expression)' +); +assert.sameValue( + x, -10, 'U+0009U+000BU+000CU+0020U+00A0U+000AU+000DU+2028U+2029 (side effect)' +); diff --git a/test/language/expressions/prefix-increment/S11.4.4_A1.js b/test/language/expressions/prefix-increment/S11.4.4_A1.js deleted file mode 100644 index 7c03423b6b..0000000000 --- a/test/language/expressions/prefix-increment/S11.4.4_A1.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: | - White Space and Line Terminator between "++" and UnaryExpression are - allowed -es5id: 11.4.4_A1 -description: Checking by using eval ----*/ - -//CHECK#1 -if (eval("var x = 0; ++\u0009x") !== 1) { - $ERROR('#1: var x = 0; ++\\u0009x; x === 1. Actual: ' + (x)); -} - -//CHECK#2 -if (eval("var x = 0; ++\u000Bx") !== 1) { - $ERROR('#2: var x = 0; ++\\u000Bx; x === 1. Actual: ' + (x)); -} - -//CHECK#3 -if (eval("var x = 0; ++\u000Cx") !== 1) { - $ERROR('#3: var x = 0; ++\\u000Cx; x === 1. Actual: ' + (x)); -} - -//CHECK#4 -if (eval("var x = 0; ++\u0020x") !== 1) { - $ERROR('#4: var x = 0; ++\\u0020x; x === 1. Actual: ' + (x)); -} - -//CHECK#5 -if (eval("var x = 0; ++\u00A0x") !== 1) { - $ERROR('#5: var x = 0; ++\\u00A0x; x === 1. Actual: ' + (x)); -} - -//CHECK#6 -if (eval("var x = 0; ++\u000Ax") !== 1) { - $ERROR('#6: var x = 0; ++\\u000Ax; x === 1. Actual: ' + (x)); -} - -//CHECK#7 -if (eval("var x = 0; ++\u000Dx") !== 1) { - $ERROR('#7: var x = 0; ++\\u000Dx; x === 1. Actual: ' + (x)); -} - -//CHECK#8 -if (eval("var x = 0; ++\u2028x") !== 1) { - $ERROR('#8: var x = 0; ++\\u2028x; x === 1. Actual: ' + (x)); -} - -//CHECK#9 -if (eval("var x = 0; ++\u2029x") !== 1) { - $ERROR('#9: var x = 0; ++\\u2029x; x === 1. Actual: ' + (x)); -} - -//CHECK#10 -if (eval("var x = 0; ++\u0009\u000B\u000C\u0020\u00A0\u000A\u000D\u2028\u2029x") !== 1) { - $ERROR('#10: var x = 0; ++\\u0009\\u000B\\u000C\\u0020\\u00A0\\u000A\\u000D\\u2028\\u2029x; x === 1. Actual: ' + (x)); -} diff --git a/test/language/expressions/prefix-increment/11.4.4-2-2-s.js b/test/language/expressions/prefix-increment/arguments.js similarity index 54% rename from test/language/expressions/prefix-increment/11.4.4-2-2-s.js rename to test/language/expressions/prefix-increment/arguments.js index 5d3209db9e..7775b81243 100644 --- a/test/language/expressions/prefix-increment/11.4.4-2-2-s.js +++ b/test/language/expressions/prefix-increment/arguments.js @@ -3,15 +3,14 @@ /*--- es5id: 11.4.4-2-2-s +esid: sec-prefix-increment-operator description: Strict Mode - SyntaxError is thrown for ++arguments flags: [onlyStrict] +negative: + phase: parse + type: SyntaxError ---*/ -function testcase() { - var blah = arguments; - assert.throws(SyntaxError, function() { - eval("++arguments;"); - }); - assert.sameValue(blah, arguments, 'blah'); - } -testcase(); +throw "Test262: This statement should not be evaluated."; + +++arguments; diff --git a/test/language/expressions/prefix-increment/11.4.4-2-1-s.js b/test/language/expressions/prefix-increment/eval.js similarity index 62% rename from test/language/expressions/prefix-increment/11.4.4-2-1-s.js rename to test/language/expressions/prefix-increment/eval.js index 35f72e827d..4770db3445 100644 --- a/test/language/expressions/prefix-increment/11.4.4-2-1-s.js +++ b/test/language/expressions/prefix-increment/eval.js @@ -3,12 +3,14 @@ /*--- es5id: 11.4.4-2-1-s +esid: sec-prefix-increment-operator description: Strict Mode - SyntaxError is thrown for ++eval flags: [onlyStrict] +negative: + phase: parse + type: SyntaxError ---*/ - var blah = eval; -assert.throws(SyntaxError, function() { - eval("++eval;"); -}); -assert.sameValue(blah, eval, 'blah'); +throw "Test262: This statement should not be evaluated."; + +++eval; diff --git a/test/language/expressions/prefix-increment/whitespace.js b/test/language/expressions/prefix-increment/whitespace.js new file mode 100644 index 0000000000..c6a08344cb --- /dev/null +++ b/test/language/expressions/prefix-increment/whitespace.js @@ -0,0 +1,50 @@ +// Copyright 2009 the Sputnik authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: | + White Space and Line Terminator between "++" and UnaryExpression are + allowed +es5id: 11.4.4_A1 +esid: sec-prefix-increment-operator +---*/ + +var x = 0; + +assert.sameValue(++ x, 1, 'U+0009 (expression)'); +assert.sameValue(x, 1, 'U+0009 (side effect)'); + +assert.sameValue(++ x, 2, 'U+000B (expression)'); +assert.sameValue(x, 2, 'U+000B (side effect)'); + +assert.sameValue(++ x, 3, 'U+000C (expression)'); +assert.sameValue(x, 3, 'U+000C (side effect)'); + +assert.sameValue(++ x, 4, 'U+0020 (expression)'); +assert.sameValue(x, 4, 'U+0020 (side effect)'); + +assert.sameValue(++ x, 5, 'U+00A0 (expression)'); +assert.sameValue(x, 5, 'U+00A0 (side effect)'); + +assert.sameValue(++ +x, 6, 'U+000A (expression)'); +assert.sameValue(x, 6, 'U+000A (side effect)'); + +assert.sameValue(++ x, 7, 'U+000D (expression)'); +assert.sameValue(x, 7, 'U+000D (side effect)'); + +assert.sameValue(++
x, 8, 'U+2028 (expression)'); +assert.sameValue(x, 8, 'U+2028 (side effect)'); + +assert.sameValue(++
x, 9, 'U+2029 (expression)'); +assert.sameValue(x, 9, 'U+2029 (side effect)'); + +assert.sameValue( + ++   + 

x, + 10, + 'U+0009U+000BU+000CU+0020U+00A0U+000AU+000DU+2028U+2029 (expression)' +); +assert.sameValue( + x, 10, 'U+0009U+000BU+000CU+0020U+00A0U+000AU+000DU+2028U+2029 (side effect)' +);