Closed
Bug 1476321
Opened 8 years ago
Closed 8 years ago
SpiderMonkey should throw ReferenceError on invalid left-hand side expression (++ ++)
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
DUPLICATE
of bug 1340307
People
(Reporter: iigor.simoes, Unassigned)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36 OPR/54.0.2952.54
Steps to reproduce:
Hi everyone,
according to ES6 (https://www.ecma-international.org/ecma-262/8.0/index.html#sec-update-expressions-static-semantics-early-errors), should throw ReferenceError if the expression is not valid on UnaryExpression.
OS: Ubuntu 16.04 x64
version: 62.0b8
var a = 1;
eval('++ ++ a;')
Actual results:
SyntaxError: expected expression, got '++'
Expected results:
ReferenceError: Invalid left-hand side expression in prefix operation (v8)
or
ReferenceError: Prefix ++ operator applied to value that is not a reference (jsc)
V8, Chakra, JSC and XS works as expected.
#### JavaScriptCore
ReferenceError: Prefix ++ operator applied to value that is not a reference.
#### V8
ReferenceError: Invalid left-hand side expression in prefix operation
#### Chakra
ReferenceError: Invalid left-hand side in assignment
#### XS
ReferenceError: no reference
#### SpiderMonkey
SyntaxError: expected expression, got '++':
Updated•8 years ago
|
Status: UNCONFIRMED → NEW
Component: Untriaged → JavaScript Engine
Ever confirmed: true
Product: Firefox → Core
Updated•8 years ago
|
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•