tree-sitter / tree-sitter-javascript

Javascript grammar for tree-sitter
MIT License
363 stars 114 forks source link

Fix: expand meta_property to include import.meta #331

Closed jackschu closed 3 months ago

jackschu commented 4 months ago

The estree spec includes import.meta as a new meta_property in es2020

https://github.com/estree/estree/blob/master/es2020.md#metaproperty

tree-sitter-javascript already considered new.target as a meta_property, which was inline inline with the spec at the time https://github.com/estree/estree/blob/master/es2015.md#metaproperty

So this diff brings us up-to-date and gives editors / tools the ability to treat these two meta properties similarly.

I also altered a test and re-generated with treesitter v0.22.6

amaanq commented 3 months ago

ty!