Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(parser): Use 'const' instead of 'let'
In the latest fixes for escaped keyword I chose to throw on "invalid left hand side in assignment" instead of invalid keyword in cases like this "var y = { c\u0061se: x } = { case: 42 };" This is a design choice, because we don't know before parsing the "=" if there is an invalid LHS assign. @aladdin-add Agree?
- Loading branch information
f1bc71f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sounds reasonable. (though I think the unchanged is more friendly to users.)
btw, the commit seems not a bugfix, it's a non-user-faced change.:-)
f1bc71f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah! Sorry! I wrote the comment here. See the 2 latest commits and you can see the changes. My mistake :)
unchanged?
The other way around is to track errors and throw them later e.g. on invalid assignment, but I'm afraid that will just kill the performance somehow.
BTW. Do you have a chance to do a PR against #34 with fixes? I'm kind of stuck in a regex mess after I discovered that V8 and other engines have a lot of invalid validations. So I'm soon done with my own :)
f1bc71f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either is fine, I don't feel strong.
re #34 , I can take care of it later. 😄