Add tests for increment and decrement operations on `this`

This commit is contained in:
Veera 2023-05-16 16:31:11 -04:00 committed by Philip Chimento
parent 4fc741b008
commit 377231a1de
4 changed files with 108 additions and 0 deletions

View File

@ -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--;

View File

@ -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++;

View File

@ -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;

View File

@ -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;