-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Support import.meta and import.meta.* #5319
Conversation
It adds a new token `IMPORT_META` allowing richer formatting and code analysis.
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.
This looks very clean. @helixbass?
Maybe not important, but this breaks indented property access like a = import
.meta
# or (forgive me...)
a = import.
meta |
@vendethiel, now it can. Thanks! |
The same is true of I'm conflicted, as these aren't actually properties of an object the way that |
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.
@aurium this is mostly looking good, see comments
And please add AST tests to test/abstract_syntax_tree.coffee
and test/abstract_syntax_tree_location.data.coffee
(you can add tests under the existing MetaProperty node
tests if you want - again you should be able to use the new.target
tests as a reference, though for import.meta
you don't need to nest inside a function body if you don't want)
I'm happy to re-review once comments are addressed
@aurium I meant the approach in general is different from how this is usually done. Might not matter in this specific case (because it's not gonna be an issue in practice), but you're always gonna break some code if you "revert" to regex scanning. b.
# Here's a nice comment about the meta property
c See @helixbass 's comment on "retroactively updating a token" |
@helixbass I added your excellent explanation as a comment in afab371 on this branch. @aurium I merged the latest Have all of the review notes been addressed? |
I believe... yes. |
Great! @helixbass and @vendethiel, do you have any more notes? |
LGTM |
1 similar comment
LGTM |
when where release this version ? |
Allows to access
import.meta
and only if its property ismeta
.The new token
IMPORT_META
was created to allow richer formatting and code analysis.closes #5317