From 04a41383b5be0e28958022658996f68722e142db Mon Sep 17 00:00:00 2001 From: Adrian Heine Date: Thu, 24 Jan 2019 10:17:27 +0100 Subject: [PATCH] UpdateExpressions: No early error for arguments and eval in non-strict mode According to sec-identifiers-static-semantics-assignmenttargettype, `AssignmentTargetType` of `arguments` and `eval` in non-strict mode code is `simple`. sec-update-expressions-static-semantics-early-errors mandates early errors for `UpdateExpression` if `AssignmentTargetType` is `invalid` or `strict`. --- .../postfix-decrement/arguments-nostrict.js | 13 ++++--------- .../expressions/postfix-decrement/eval-nostrict.js | 13 ++++--------- .../postfix-increment/arguments-nostrict.js | 13 ++++--------- .../expressions/postfix-increment/eval-nostrict.js | 13 ++++--------- .../prefix-decrement/arguments-nostrict.js | 13 ++++--------- .../expressions/prefix-decrement/eval-nostrict.js | 13 ++++--------- .../prefix-increment/arguments-nostrict.js | 13 ++++--------- .../expressions/prefix-increment/eval-nostrict.js | 13 ++++--------- 8 files changed, 32 insertions(+), 72 deletions(-) diff --git a/test/language/expressions/postfix-decrement/arguments-nostrict.js b/test/language/expressions/postfix-decrement/arguments-nostrict.js index e851a7c8fb..a6dc6e9d80 100644 --- a/test/language/expressions/postfix-decrement/arguments-nostrict.js +++ b/test/language/expressions/postfix-decrement/arguments-nostrict.js @@ -7,24 +7,19 @@ description: > It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. (arguments) info: | - sec-update-expressions-static-semantics-assignmenttargettype + sec-identifiers-static-semantics-assignmenttargettype - UpdateExpression : LeftHandSideExpression -- - - Return invalid. + 1. If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. + 2. Return simple. sec-update-expressions-static-semantics-early-errors UpdateExpression : LeftHandSideExpression -- It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is strict. flags: [noStrict] -negative: - phase: parse - type: ReferenceError ---*/ -$DONOTEVALUATE(); - arguments--; diff --git a/test/language/expressions/postfix-decrement/eval-nostrict.js b/test/language/expressions/postfix-decrement/eval-nostrict.js index 8e7131b6e1..3aac9b9831 100644 --- a/test/language/expressions/postfix-decrement/eval-nostrict.js +++ b/test/language/expressions/postfix-decrement/eval-nostrict.js @@ -7,24 +7,19 @@ description: > It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. (eval) info: | - sec-update-expressions-static-semantics-assignmenttargettype + sec-identifiers-static-semantics-assignmenttargettype - UpdateExpression : LeftHandSideExpression -- - - Return invalid. + 1. If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. + 2. Return simple. sec-update-expressions-static-semantics-early-errors UpdateExpression : LeftHandSideExpression -- It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is strict. flags: [noStrict] -negative: - phase: parse - type: ReferenceError ---*/ -$DONOTEVALUATE(); - eval--; diff --git a/test/language/expressions/postfix-increment/arguments-nostrict.js b/test/language/expressions/postfix-increment/arguments-nostrict.js index bdc6a559a5..0c7fa5bbb4 100644 --- a/test/language/expressions/postfix-increment/arguments-nostrict.js +++ b/test/language/expressions/postfix-increment/arguments-nostrict.js @@ -7,24 +7,19 @@ description: > It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. (arguments) info: | - sec-update-expressions-static-semantics-assignmenttargettype + sec-identifiers-static-semantics-assignmenttargettype - UpdateExpression : LeftHandSideExpression ++ - - Return invalid. + 1. If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. + 2. Return simple. sec-update-expressions-static-semantics-early-errors UpdateExpression : LeftHandSideExpression ++ It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is strict. flags: [noStrict] -negative: - phase: parse - type: ReferenceError ---*/ -$DONOTEVALUATE(); - arguments++; diff --git a/test/language/expressions/postfix-increment/eval-nostrict.js b/test/language/expressions/postfix-increment/eval-nostrict.js index 10135e5d0b..94e7a8288a 100644 --- a/test/language/expressions/postfix-increment/eval-nostrict.js +++ b/test/language/expressions/postfix-increment/eval-nostrict.js @@ -7,24 +7,19 @@ description: > It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. (eval) info: | - sec-update-expressions-static-semantics-assignmenttargettype + sec-identifiers-static-semantics-assignmenttargettype - UpdateExpression : LeftHandSideExpression ++ - - Return invalid. + 1. If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. + 2. Return simple. sec-update-expressions-static-semantics-early-errors UpdateExpression : LeftHandSideExpression ++ It is an early Reference Error if AssignmentTargetType of LeftHandSideExpression is invalid. + It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is strict. flags: [noStrict] -negative: - phase: parse - type: ReferenceError ---*/ -$DONOTEVALUATE(); - eval++; diff --git a/test/language/expressions/prefix-decrement/arguments-nostrict.js b/test/language/expressions/prefix-decrement/arguments-nostrict.js index 0d3aeb831e..7afe1169fd 100644 --- a/test/language/expressions/prefix-decrement/arguments-nostrict.js +++ b/test/language/expressions/prefix-decrement/arguments-nostrict.js @@ -7,24 +7,19 @@ description: > It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. (arguments) info: | - sec-update-expressions-static-semantics-assignmenttargettype + sec-identifiers-static-semantics-assignmenttargettype - UpdateExpression : -- UnaryExpression - - Return invalid. + 1. If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. + 2. Return simple. sec-update-expressions-static-semantics-early-errors UpdateExpression -- UnaryExpression It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. + It is an early Syntax Error if AssignmentTargetType of UnaryExpression is strict. flags: [noStrict] -negative: - phase: parse - type: ReferenceError ---*/ -$DONOTEVALUATE(); - --arguments; diff --git a/test/language/expressions/prefix-decrement/eval-nostrict.js b/test/language/expressions/prefix-decrement/eval-nostrict.js index 0716961449..b9a88eca0d 100644 --- a/test/language/expressions/prefix-decrement/eval-nostrict.js +++ b/test/language/expressions/prefix-decrement/eval-nostrict.js @@ -7,24 +7,19 @@ description: > It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. (eval) info: | - sec-update-expressions-static-semantics-assignmenttargettype + sec-identifiers-static-semantics-assignmenttargettype - UpdateExpression : -- UnaryExpression - - Return invalid. + 1. If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. + 2. Return simple. sec-update-expressions-static-semantics-early-errors UpdateExpression -- UnaryExpression It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. + It is an early Syntax Error if AssignmentTargetType of UnaryExpression is strict. flags: [noStrict] -negative: - phase: parse - type: ReferenceError ---*/ -$DONOTEVALUATE(); - --eval; diff --git a/test/language/expressions/prefix-increment/arguments-nostrict.js b/test/language/expressions/prefix-increment/arguments-nostrict.js index 469292acbd..306b28ef83 100644 --- a/test/language/expressions/prefix-increment/arguments-nostrict.js +++ b/test/language/expressions/prefix-increment/arguments-nostrict.js @@ -7,24 +7,19 @@ description: > It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. (arguments) info: | - sec-update-expressions-static-semantics-assignmenttargettype + sec-identifiers-static-semantics-assignmenttargettype - UpdateExpression : ++ UnaryExpression - - Return invalid. + 1. If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. + 2. Return simple. sec-update-expressions-static-semantics-early-errors UpdateExpression ++ UnaryExpression It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. + It is an early Syntax Error if AssignmentTargetType of UnaryExpression is strict. flags: [noStrict] -negative: - phase: parse - type: ReferenceError ---*/ -$DONOTEVALUATE(); - ++arguments; diff --git a/test/language/expressions/prefix-increment/eval-nostrict.js b/test/language/expressions/prefix-increment/eval-nostrict.js index 9f6258bcd9..110c2738ed 100644 --- a/test/language/expressions/prefix-increment/eval-nostrict.js +++ b/test/language/expressions/prefix-increment/eval-nostrict.js @@ -7,24 +7,19 @@ description: > It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. (eval) info: | - sec-update-expressions-static-semantics-assignmenttargettype + sec-identifiers-static-semantics-assignmenttargettype - UpdateExpression : ++ UnaryExpression - - Return invalid. + 1. If this IdentifierReference is contained in strict mode code and StringValue of Identifier is "eval" or "arguments", return strict. + 2. Return simple. sec-update-expressions-static-semantics-early-errors UpdateExpression ++ UnaryExpression It is an early Reference Error if AssignmentTargetType of UnaryExpression is invalid. + It is an early Syntax Error if AssignmentTargetType of UnaryExpression is strict. flags: [noStrict] -negative: - phase: parse - type: ReferenceError ---*/ -$DONOTEVALUATE(); - ++eval;