Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upRationale behind early ReferenceError and early SyntaxError #1267
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
IgnoredAmbience
Jul 19, 2018
Member
It looks like this was previously raised as a bug in the ES6 spec period and got deferred to ES7, but never resolved?
https://tc39.github.io/archives/bugzilla/4375/
|
It looks like this was previously raised as a bug in the ES6 spec period and got deferred to ES7, but never resolved? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment
Hide comment
|
PR #1132 is open already to fix this as well. |
anba
referenced this issue
Jul 19, 2018
Merged
Restore early SyntaxError for strict mode assignment to eval/arguments #1132
ljharb
added
the
question
label
Jul 19, 2018
ljharb
closed this
in
#1132
Aug 1, 2018
ljharb
added
spec bug
web reality
and removed
question
labels
Aug 1, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Constellation commentedJul 19, 2018
I'm attempting to update JSC's parser to accept early
ReferenceErrorconcept.But I don't get the point of the rationale behind early ReferenceError and SyntaxError yet.
According to the spec[1,2],
should raise early ReferenceError. On the other hand,
should raise early SyntaxError[3].
What makes this differences? Why are IdentifierReference in Object/ArrayPatterns handled differently from usual AssignmentExpression LHS's IdentifierReference?
This is a bit confusing and it seems that even test262 does not test it correctly (see
test/language/expressions/assignment/id-arguments-strict.jsfor example).1: https://tc39.github.io/ecma262/#sec-assignment-operators-static-semantics-early-errors
2: https://tc39.github.io/ecma262/#sec-identifiers-static-semantics-isvalidsimpleassignmenttarget
3: https://tc39.github.io/ecma262/#sec-destructuring-assignment-static-semantics-early-errors