mirror of https://github.com/tc39/test262.git
Add tests for increment and decrement operations on `this`
This commit is contained in:
parent
4fc741b008
commit
377231a1de
|
@ -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--;
|
|
@ -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++;
|
|
@ -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;
|
|
@ -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;
|
Loading…
Reference in New Issue