-
Notifications
You must be signed in to change notification settings - Fork 930
add import.meta
#943
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
add import.meta
#943
Conversation
Thanks! I'm waiting for the ESTree thing to merge again. (Yeah, I know, #890 and #890 are also still stuck, after way too long, but supposedly there's interest from @nzakas and @RReverser to try and find a way to move ESTree decisions forward more effectively.) |
We have already agreed on using |
if (node.property.name !== "meta") | ||
this.raiseRecoverable(node.property.start, "The only valid meta property for import is import.meta") | ||
if (containsEsc) | ||
this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters") |
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.
Do we have same error in new.target
? We probably would want these error messages to align.
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.
I have pushed 0164a93 to align the error messages.
For a reference, "'import.meta' must not contain escaped characters" is the same message as Chrome 80.
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.
I don't think it matters much to align with some engine, but internal consistency is important. Thanks for fixing!
mysticatea:import-meta |
This PR adds
import.meta
support into acorn. It representsimport.meta
as aMetaProperty
node.Upstreams:
import.meta
to ES2020 estree/estree#210