Closed Bug 1340307 Opened 7 years ago Closed 5 years ago

Throw ReferenceError instead of SyntaxError when applying increment/decrement operator on invalid target

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

RESOLVED INVALID
Tracking Status
firefox54 --- affected

People

(Reporter: anba, Unassigned)

References

Details

(Keywords: triage-deferred)

js> ++0;
typein:1:2 SyntaxError: invalid increment/decrement operand:
typein:1:2 ++0;
typein:1:2 ..^


Expected: Throws ReferenceError
Actual: Throws SyntaxError
This is required for test262 module tests. No, I'm not kidding...! :-/
Making all of these early ReferenceError into early SyntaxError is an ECMA-262 change that's just waiting for someone to attempt it, to give feedback on whether it's possible.  Can you just disable the few affected tests for a short-term fix, and then one of us can super-immediately flip all the early ReferenceErrors to early SyntaxErrors so we're not sitting on that change any longer?
(In reply to Jeff Walden [:Waldo] (remove +bmo to email) from comment #2)
> Can you just disable the few affected tests for a short-term fix, [...]

Sure, I can disable the affected tests.
Keywords: triage-deferred
Priority: -- → P3

Good news! The spec change to abolish early ReferenceError reached consensus this morning in Berlin:
https://github.com/tc39/ecma262/pull/1527

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID

See bug 1556818 for the one case 0 = 0 that needs to be fixed.

You need to log in before you can comment on or make changes to this bug.