Adrian Heine 04a41383b5 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`.
2019-01-25 12:39:02 -05:00

26 lines
881 B
JavaScript

// 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-identifiers-static-semantics-assignmenttargettype
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]
---*/
arguments++;