-
-
Notifications
You must be signed in to change notification settings - Fork 413
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
[Merged by Bors] - Allow some keywords as identifiers #2269
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2269 +/- ##
==========================================
+ Coverage 41.35% 41.48% +0.12%
==========================================
Files 234 234
Lines 22019 21987 -32
==========================================
+ Hits 9107 9121 +14
+ Misses 12912 12866 -46
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Test262 conformance changesVM implementation
Fixed tests (16):
|
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.
Thank you for the fix!
I added some comments for potential enhancements. It seems that this test is failing, though:
https://github.com/tc39/test262/blob/f1870753fa616261193b99f79d996889921b3404/test/language/statements/for-of/head-lhs-async-invalid.js
It seems that the async cannot be placed in a for-of. The spec for this is here. It seems it requires a var
, a let
or a const
for it to be valid. This might require changes in the for-of parser.
It seems that the fix for the for...off has broken these tests, that were passing with your previous version:
It turns out that the It's not that critical, since this was broken before, but if you can find a solution that would be perfect :) |
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.
It's ready to be merged from my side :) thanks!
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.
Great work!
bors r+ |
This PR fixes #2275 There are keywords that are allowed as identifiers. https://tc39.es/ecma262/#sec-keywords-and-reserved-words > Those that are always allowed as identifiers, but also appear as keywords within certain syntactic productions, at places where Identifier is not allowed: as, async, from, get, meta, of, set, and target. This PR adds test cases for them, and fixes some cases such as `class A { set(a, b) { } }` `function of() { }` `let obj = {async: true}` `async()`
Pull request successfully merged into main. Build succeeded: |
This PR fixes #2275
There are keywords that are allowed as identifiers.
https://tc39.es/ecma262/#sec-keywords-and-reserved-words
This PR adds test cases for them, and fixes some cases such as
class A { set(a, b) { } }
function of() { }
let obj = {async: true}
async()