Skip to content

Conversation

mysticatea
Copy link
Contributor

tc39/proposals@0c27379

import.meta meta property syntax has arrived at Stage 4 in the 75th TC39 meeting.

This PR brings the syntax into ESTree.
The existing MetaProperty node represents import.meta meta property as well.

@RReverser
Copy link
Member

Looks reasonable, although I'm not sure if we need to explicitly list all meta properties (at least we didn't do that in the original PR #32 either).

@mysticatea
Copy link
Contributor Author

@RReverser I think worthful if we mention it explicitly because ESTree was representing dynamic imports and import.meta with Import node in the past (#137).

@RReverser
Copy link
Member

@mysticatea Huh. Dynamic imports, sure, but import.meta? If it did, it probably was a bug in a parser (or an accident), not something intentional. The PR you referred only mentions dynamic import.

Anyway, adding explicit mention of meta property sounds good, but can you please add the existing new.target mention to es5.md too then for consistency?

@mysticatea
Copy link
Contributor Author

Sure, I added the mention of new.target.

Off-topic:

(in my understanding, the Import node was introduced to represent import() and import.foo in the same manner of Super. So, there was a question about import.meta when I brought ImportExpression node (#197).)

@RReverser
Copy link
Member

in my understanding, the Import node was introduced

Ah, I see what you're saying.

We did temporarily have Import in an experimental folder, but we ended up with ImportExpression instead, which doesn't (can't) cover import.meta, hence the confusion.

Copy link
Member

@RReverser RReverser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty straightforward and doesn't introduce anything new, so merging as-is. Thanks!

@RReverser RReverser merged commit 70d58d7 into estree:master Apr 2, 2020
@mysticatea mysticatea deleted the import-meta branch April 2, 2020 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants