Replace all early ReferenceErrors with early SyntaxErrors.


The spec has been inconsistent with respect to the "early ReferenceError" notion: only update/assignment expressions (e.g. `0++`, `0 = 0`) throw early ReferenceErrors, while other invalid assignments like `[0] = []` and `for (0 of []) {}` throw early SyntaxErrors. Furthermore, this becomes an observable concern with eval. If eval throws a ReferenceError, the user has had no way to know whether the code was actually executed or simply parsed (short of matching on error message strings).



Specification link

Specification being incubated in a Community Group

Status in Chromium


In development (tracking bug)

Consensus & Standardization

After a feature ships in Chrome, the values listed here are not guaranteed to be up to date.

  • No signal
  • No signal
  • No signals


Last updated on 2022-01-21