UpdateExpressions: add necessary changes to tests to reflect latest specification.

This commit is contained in:
Rick Waldron 2018-12-18 12:56:34 -05:00
parent dab8c8983a
commit 73705f8801
20 changed files with 348 additions and 96 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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