diff --git a/test/language/expressions/postfix-decrement/this.js b/test/language/expressions/postfix-decrement/this.js new file mode 100644 index 0000000000..58526991db --- /dev/null +++ b/test/language/expressions/postfix-decrement/this.js @@ -0,0 +1,27 @@ +// Copyright (c) 2023 Ecma International. 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 Syntax Error if AssignmentTargetType of LeftHandSideExpression is not simple. (this) +info: | + sec-static-semantics-assignmenttargettype + + PrimaryExpression : this + + Return invalid. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression: LeftHandSideExpression -- + + It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is not simple. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +this--; diff --git a/test/language/expressions/postfix-increment/this.js b/test/language/expressions/postfix-increment/this.js new file mode 100644 index 0000000000..1f7266bae6 --- /dev/null +++ b/test/language/expressions/postfix-increment/this.js @@ -0,0 +1,27 @@ +// Copyright (c) 2023 Ecma International. 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 Syntax Error if AssignmentTargetType of LeftHandSideExpression is not simple. (this) +info: | + sec-static-semantics-assignmenttargettype + + PrimaryExpression : this + + Return invalid. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression: LeftHandSideExpression ++ + + It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is not simple. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +this++; diff --git a/test/language/expressions/prefix-decrement/this.js b/test/language/expressions/prefix-decrement/this.js new file mode 100644 index 0000000000..fa2e8764ef --- /dev/null +++ b/test/language/expressions/prefix-decrement/this.js @@ -0,0 +1,27 @@ +// Copyright (c) 2023 Ecma International. 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 Syntax Error if AssignmentTargetType of UnaryExpression is not simple. (this) +info: | + sec-static-semantics-assignmenttargettype + + PrimaryExpression : this + + Return invalid. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression: -- UnaryExpression + + It is an early Syntax Error if AssignmentTargetType of UnaryExpression is not simple. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +--this; diff --git a/test/language/expressions/prefix-increment/this.js b/test/language/expressions/prefix-increment/this.js new file mode 100644 index 0000000000..faff8226dc --- /dev/null +++ b/test/language/expressions/prefix-increment/this.js @@ -0,0 +1,27 @@ +// Copyright (c) 2023 Ecma International. 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 Syntax Error if AssignmentTargetType of UnaryExpression is not simple. (this) +info: | + sec-static-semantics-assignmenttargettype + + PrimaryExpression : this + + Return invalid. + + sec-update-expressions-static-semantics-early-errors + + UpdateExpression: ++ UnaryExpression + + It is an early Syntax Error if AssignmentTargetType of UnaryExpression is not simple. +negative: + phase: parse + type: SyntaxError +---*/ + +$DONOTEVALUATE(); + +++this;