-
Notifications
You must be signed in to change notification settings - Fork 732
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove obsolete future reserved keywords from javascript.rb. #1126
Conversation
These keywords are no longer reserved. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Future_reserved_keywords There might be no backward compatibility issue because they have never really been keyword.
I ran it locally and tests passed fine. I can kind of see the backwards compatibility argument but that's true about any update to a lexer that changes behaviour based on changes to the language. |
According to ES2018 specification, the Latest ECMA Standards(https://www.ecma-international.org/ecma-262/9.0/index.html#sec-keywords), the following are the keywords: ``` await break case catch class const continue debugger default delete do else export extends finally for function if import in instanceof new return super switch this throw try typeof var void while with yield ``` The list above has some declarations keywords so I removed it. And the list lacks some words that is used as keyword: 'from', 'as', 'of', and 'async'. I added these 4 words because they have been in our list and should be highlighted. So as the result I just added 'await' and 'debugger' to our list and nothing is removed.
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.
The list of identifiers in both self.keywords
and self.reserved
doesn't actually match the reserved words in the ES6 spec. Do you think it's worth taking this opportunity to update everything to be consistent?
@pyrmont Yes, would be more consistent. I'll make a PR. |
Thanks! Feel free just to update this PR :) |
Update the keywords, the declarations, and the reserved words according to the latest ES Specification. Some words like 'async', 'from', and 'of' are not listed as keyword in the specification but I added them to our list of keywords because they have already been, and widely recognized as keywords. For more detail please see the commit messages. |
These keywords are no longer reserved(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#Future_reserved_keywords). There might be no backward compatibility issue because they have never really been keyword.