From 73705f88014183b3eab8593f91ec769d957cd200 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Tue, 18 Dec 2018 12:56:34 -0500 Subject: [PATCH] UpdateExpressions: add necessary changes to tests to reflect latest specification. --- .../postfix-decrement/arguments-nostrict.js | 30 +++++++++++++++++++ .../postfix-decrement/arguments.js | 18 ++++++++--- .../postfix-decrement/eval-nostrict.js | 30 +++++++++++++++++++ .../expressions/postfix-decrement/eval.js | 18 ++++++++--- .../postfix-decrement/non-simple.js | 17 ----------- .../postfix-increment/arguments-nostrict.js | 30 +++++++++++++++++++ .../postfix-increment/arguments.js | 14 ++++++--- .../postfix-increment/eval-nostrict.js | 30 +++++++++++++++++++ .../expressions/postfix-increment/eval.js | 14 ++++++--- .../postfix-increment/non-simple.js | 17 ----------- .../prefix-decrement/arguments-nostrict.js | 30 +++++++++++++++++++ .../expressions/prefix-decrement/arguments.js | 18 +++++++++-- .../prefix-decrement/eval-nostrict.js | 30 +++++++++++++++++++ .../expressions/prefix-decrement/eval.js | 18 +++++++++-- .../prefix-decrement/non-simple.js | 17 ----------- .../prefix-increment/arguments-nostrict.js | 30 +++++++++++++++++++ .../expressions/prefix-increment/arguments.js | 18 +++++++++-- .../prefix-increment/eval-nostrict.js | 30 +++++++++++++++++++ .../expressions/prefix-increment/eval.js | 18 +++++++++-- .../prefix-increment/non-simple.js | 17 ----------- 20 files changed, 348 insertions(+), 96 deletions(-) create mode 100644 test/language/expressions/postfix-decrement/arguments-nostrict.js create mode 100644 test/language/expressions/postfix-decrement/eval-nostrict.js delete mode 100644 test/language/expressions/postfix-decrement/non-simple.js create mode 100644 test/language/expressions/postfix-increment/arguments-nostrict.js create mode 100644 test/language/expressions/postfix-increment/eval-nostrict.js delete mode 100644 test/language/expressions/postfix-increment/non-simple.js create mode 100644 test/language/expressions/prefix-decrement/arguments-nostrict.js create mode 100644 test/language/expressions/prefix-decrement/eval-nostrict.js delete mode 100644 test/language/expressions/prefix-decrement/non-simple.js create mode 100644 test/language/expressions/prefix-increment/arguments-nostrict.js create mode 100644 test/language/expressions/prefix-increment/eval-nostrict.js delete mode 100644 test/language/expressions/prefix-increment/non-simple.js diff --git a/test/language/expressions/postfix-decrement/arguments-nostrict.js b/test/language/expressions/postfix-decrement/arguments-nostrict.js new file mode 100644 index 0000000000..e851a7c8fb --- /dev/null +++ b/test/language/expressions/postfix-decrement/arguments-nostrict.js @@ -0,0 +1,30 @@ +// Copyright (c) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-update-expressions-static-semantics-early-errors +description: > + It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. (arguments) +info: | + + sec-update-expressions-static-semantics-assignmenttargettype + + UpdateExpression : LeftHandSideExpression -- + + Return invalid. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression : LeftHandSideExpression -- + + It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + +flags: [noStrict] +negative: + phase: parse + type: ReferenceError +---*/ + +$DONOTEVALUATE(); + +arguments--; diff --git a/test/language/expressions/postfix-decrement/arguments.js b/test/language/expressions/postfix-decrement/arguments.js index f7188c760a..6e6bc0c89d 100644 --- a/test/language/expressions/postfix-decrement/arguments.js +++ b/test/language/expressions/postfix-decrement/arguments.js @@ -2,11 +2,21 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -es5id: 11.3.2-2-1-s -esid: sec-postfix-decrement-operator +esid: sec-update-expressions description: > - Strict Mode - SyntaxError is thrown if the identifier 'arguments' - appear as a PostfixExpression(arguments--) + It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is strict. (arguments) +info: | + + sec-identifiers-static-semantics-assignmenttargettype + + If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression: LeftHandSideExpression -- + + It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is strict. + flags: [onlyStrict] negative: phase: parse diff --git a/test/language/expressions/postfix-decrement/eval-nostrict.js b/test/language/expressions/postfix-decrement/eval-nostrict.js new file mode 100644 index 0000000000..8e7131b6e1 --- /dev/null +++ b/test/language/expressions/postfix-decrement/eval-nostrict.js @@ -0,0 +1,30 @@ +// Copyright (c) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-update-expressions +description: > + It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. (eval) +info: | + + sec-update-expressions-static-semantics-assignmenttargettype + + UpdateExpression : LeftHandSideExpression -- + + Return invalid. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression : LeftHandSideExpression -- + + It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + +flags: [noStrict] +negative: + phase: parse + type: ReferenceError +---*/ + +$DONOTEVALUATE(); + +eval--; diff --git a/test/language/expressions/postfix-decrement/eval.js b/test/language/expressions/postfix-decrement/eval.js index 4a7a263910..fb6d18c47a 100644 --- a/test/language/expressions/postfix-decrement/eval.js +++ b/test/language/expressions/postfix-decrement/eval.js @@ -2,11 +2,21 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -es5id: 11.3.2-2-2-s -esid: sec-postfix-decrement-operator +esid: sec-update-expressions description: > - Strict Mode - SyntaxError is thrown if the identifier 'eval' - appear as a PostfixExpression(eval--) + It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is strict. (eval) +info: | + + sec-identifiers-static-semantics-assignmenttargettype + + If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression: LeftHandSideExpression -- + + It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is strict. + flags: [onlyStrict] negative: phase: parse diff --git a/test/language/expressions/postfix-decrement/non-simple.js b/test/language/expressions/postfix-decrement/non-simple.js deleted file mode 100644 index cc323d7d71..0000000000 --- a/test/language/expressions/postfix-decrement/non-simple.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: | - It is an early Reference Error if IsValidSimpleAssignmentTarget of - LeftHandSideExpression is false. -es6id: 12.4.1 -description: Applied to a non-simple assignment target -negative: - phase: parse - type: ReferenceError ----*/ - -$DONOTEVALUATE(); - -1--; diff --git a/test/language/expressions/postfix-increment/arguments-nostrict.js b/test/language/expressions/postfix-increment/arguments-nostrict.js new file mode 100644 index 0000000000..bdc6a559a5 --- /dev/null +++ b/test/language/expressions/postfix-increment/arguments-nostrict.js @@ -0,0 +1,30 @@ +// Copyright (c) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-update-expressions-static-semantics-early-errors +description: > + It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. (arguments) +info: | + + sec-update-expressions-static-semantics-assignmenttargettype + + UpdateExpression : LeftHandSideExpression ++ + + Return invalid. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression : LeftHandSideExpression ++ + + It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + +flags: [noStrict] +negative: + phase: parse + type: ReferenceError +---*/ + +$DONOTEVALUATE(); + +arguments++; diff --git a/test/language/expressions/postfix-increment/arguments.js b/test/language/expressions/postfix-increment/arguments.js index b2bfce27c4..50110ba660 100644 --- a/test/language/expressions/postfix-increment/arguments.js +++ b/test/language/expressions/postfix-increment/arguments.js @@ -2,11 +2,17 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -es5id: 11.3.1-2-1-s -esid: postfix-increment-operator +esid: sec-identifiers-static-semantics-assignmenttargettype description: > - Strict Mode - SyntaxError is thrown if the identifier 'arguments' - appear as a PostfixExpression(arguments++) + If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. +info: | + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression: LeftHandSideExpression ++ + + It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is strict. + flags: [onlyStrict] negative: phase: parse diff --git a/test/language/expressions/postfix-increment/eval-nostrict.js b/test/language/expressions/postfix-increment/eval-nostrict.js new file mode 100644 index 0000000000..10135e5d0b --- /dev/null +++ b/test/language/expressions/postfix-increment/eval-nostrict.js @@ -0,0 +1,30 @@ +// Copyright (c) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-update-expressions +description: > + It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. (eval) +info: | + + sec-update-expressions-static-semantics-assignmenttargettype + + UpdateExpression : LeftHandSideExpression ++ + + Return invalid. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression : LeftHandSideExpression ++ + + It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + +flags: [noStrict] +negative: + phase: parse + type: ReferenceError +---*/ + +$DONOTEVALUATE(); + +eval++; diff --git a/test/language/expressions/postfix-increment/eval.js b/test/language/expressions/postfix-increment/eval.js index 329dae9e1c..503d485aa9 100644 --- a/test/language/expressions/postfix-increment/eval.js +++ b/test/language/expressions/postfix-increment/eval.js @@ -2,11 +2,17 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -es5id: 11.3.1-2-2-s -esid: postfix-increment-operator +esid: sec-identifiers-static-semantics-assignmenttargettype description: > - Strict Mode - SyntaxError is thrown if the identifier 'eval' - appear as a PostfixExpression(eval++) + If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. +info: | + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression: LeftHandSideExpression ++ + + It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is strict. + flags: [onlyStrict] negative: phase: parse diff --git a/test/language/expressions/postfix-increment/non-simple.js b/test/language/expressions/postfix-increment/non-simple.js deleted file mode 100644 index 5494f1be5b..0000000000 --- a/test/language/expressions/postfix-increment/non-simple.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: | - It is an early Reference Error if IsValidSimpleAssignmentTarget of - LeftHandSideExpression is false. -es6id: 12.4.1 -description: Applied to a non-simple assignment target -negative: - phase: parse - type: ReferenceError ----*/ - -$DONOTEVALUATE(); - -1++; diff --git a/test/language/expressions/prefix-decrement/arguments-nostrict.js b/test/language/expressions/prefix-decrement/arguments-nostrict.js new file mode 100644 index 0000000000..0d3aeb831e --- /dev/null +++ b/test/language/expressions/prefix-decrement/arguments-nostrict.js @@ -0,0 +1,30 @@ +// Copyright (c) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-update-expressions +description: > + It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. (arguments) +info: | + + sec-update-expressions-static-semantics-assignmenttargettype + + UpdateExpression : -- UnaryExpression + + Return invalid. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression -- UnaryExpression + + It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. + +flags: [noStrict] +negative: + phase: parse + type: ReferenceError +---*/ + +$DONOTEVALUATE(); + +--arguments; diff --git a/test/language/expressions/prefix-decrement/arguments.js b/test/language/expressions/prefix-decrement/arguments.js index a740557056..1bb3f7c3e3 100644 --- a/test/language/expressions/prefix-decrement/arguments.js +++ b/test/language/expressions/prefix-decrement/arguments.js @@ -2,9 +2,21 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -es5id: 11.4.5-2-2-s -esid: sec-prefix-decrement-operator -description: Strict Mode - SyntaxError is thrown for --arguments +esid: sec-update-expressions +description: > + It is an early Syntax Error if AssignmentTargetType of UnaryExpression is strict. (arguments) +info: | + + sec-identifiers-static-semantics-assignmenttargettype + + If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression: -- UnaryExpression + + It is an early Syntax Error if AssignmentTargetType of UnaryExpression is strict. + flags: [onlyStrict] negative: phase: parse diff --git a/test/language/expressions/prefix-decrement/eval-nostrict.js b/test/language/expressions/prefix-decrement/eval-nostrict.js new file mode 100644 index 0000000000..0716961449 --- /dev/null +++ b/test/language/expressions/prefix-decrement/eval-nostrict.js @@ -0,0 +1,30 @@ +// Copyright (c) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-update-expressions +description: > + It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. (eval) +info: | + + sec-update-expressions-static-semantics-assignmenttargettype + + UpdateExpression : -- UnaryExpression + + Return invalid. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression -- UnaryExpression + + It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. + +flags: [noStrict] +negative: + phase: parse + type: ReferenceError +---*/ + +$DONOTEVALUATE(); + +--eval; diff --git a/test/language/expressions/prefix-decrement/eval.js b/test/language/expressions/prefix-decrement/eval.js index cd5737c98a..5650117b47 100644 --- a/test/language/expressions/prefix-decrement/eval.js +++ b/test/language/expressions/prefix-decrement/eval.js @@ -2,9 +2,21 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -es5id: 11.4.5-2-1-s -esid: sec-prefix-decrement-operator -description: Strict Mode - SyntaxError is thrown for --eval +esid: sec-update-expressions +description: > + It is an early Syntax Error if AssignmentTargetType of UnaryExpression is strict. (eval) +info: | + + sec-identifiers-static-semantics-assignmenttargettype + + If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression: -- UnaryExpression + + It is an early Syntax Error if AssignmentTargetType of UnaryExpression is strict. + flags: [onlyStrict] negative: phase: parse diff --git a/test/language/expressions/prefix-decrement/non-simple.js b/test/language/expressions/prefix-decrement/non-simple.js deleted file mode 100644 index e11e1e6966..0000000000 --- a/test/language/expressions/prefix-decrement/non-simple.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: | - It is an early Reference Error if IsValidSimpleAssignmentTarget of - UnaryExpression is false. -es5id: 12.5.1 -description: Applied to a non-simple assignment target -negative: - phase: parse - type: ReferenceError ----*/ - -$DONOTEVALUATE(); - ---1; diff --git a/test/language/expressions/prefix-increment/arguments-nostrict.js b/test/language/expressions/prefix-increment/arguments-nostrict.js new file mode 100644 index 0000000000..469292acbd --- /dev/null +++ b/test/language/expressions/prefix-increment/arguments-nostrict.js @@ -0,0 +1,30 @@ +// Copyright (c) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-update-expressions +description: > + It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. (arguments) +info: | + + sec-update-expressions-static-semantics-assignmenttargettype + + UpdateExpression : ++ UnaryExpression + + Return invalid. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression ++ UnaryExpression + + It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. + +flags: [noStrict] +negative: + phase: parse + type: ReferenceError +---*/ + +$DONOTEVALUATE(); + +++arguments; diff --git a/test/language/expressions/prefix-increment/arguments.js b/test/language/expressions/prefix-increment/arguments.js index c8e0c2e039..1c88097c36 100644 --- a/test/language/expressions/prefix-increment/arguments.js +++ b/test/language/expressions/prefix-increment/arguments.js @@ -2,9 +2,21 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -es5id: 11.4.4-2-2-s -esid: sec-prefix-increment-operator -description: Strict Mode - SyntaxError is thrown for ++arguments +esid: sec-update-expressions +description: > + It is an early Syntax Error if AssignmentTargetType of UnaryExpression is strict. (arguments) +info: | + + sec-identifiers-static-semantics-assignmenttargettype + + If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression: ++ UnaryExpression + + It is an early Syntax Error if AssignmentTargetType of UnaryExpression is strict. + flags: [onlyStrict] negative: phase: parse diff --git a/test/language/expressions/prefix-increment/eval-nostrict.js b/test/language/expressions/prefix-increment/eval-nostrict.js new file mode 100644 index 0000000000..9f6258bcd9 --- /dev/null +++ b/test/language/expressions/prefix-increment/eval-nostrict.js @@ -0,0 +1,30 @@ +// Copyright (c) 2018 Rick Waldron. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-update-expressions +description: > + It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. (eval) +info: | + + sec-update-expressions-static-semantics-assignmenttargettype + + UpdateExpression : ++ UnaryExpression + + Return invalid. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression ++ UnaryExpression + + It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. + +flags: [noStrict] +negative: + phase: parse + type: ReferenceError +---*/ + +$DONOTEVALUATE(); + +++eval; diff --git a/test/language/expressions/prefix-increment/eval.js b/test/language/expressions/prefix-increment/eval.js index c8477cef8b..bca64aee01 100644 --- a/test/language/expressions/prefix-increment/eval.js +++ b/test/language/expressions/prefix-increment/eval.js @@ -2,9 +2,21 @@ // This code is governed by the BSD license found in the LICENSE file. /*--- -es5id: 11.4.4-2-1-s -esid: sec-prefix-increment-operator -description: Strict Mode - SyntaxError is thrown for ++eval +esid: sec-update-expressions +description: > + It is an early Syntax Error if AssignmentTargetType of UnaryExpression is strict. (eval) +info: | + + sec-identifiers-static-semantics-assignmenttargettype + + If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression: ++ UnaryExpression + + It is an early Syntax Error if AssignmentTargetType of UnaryExpression is strict. + flags: [onlyStrict] negative: phase: parse diff --git a/test/language/expressions/prefix-increment/non-simple.js b/test/language/expressions/prefix-increment/non-simple.js deleted file mode 100644 index 300ecf4849..0000000000 --- a/test/language/expressions/prefix-increment/non-simple.js +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2009 the Sputnik authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -info: | - It is an early Reference Error if IsValidSimpleAssignmentTarget of - UnaryExpression is false. -es6id: 12.5.1 -description: Applied to a non-simple assignment target -negative: - phase: parse - type: ReferenceError ----*/ - -$DONOTEVALUATE(); - -++1;