jquery / esprima

ECMAScript parsing infrastructure for multipurpose analysis
http://esprima.org
BSD 2-Clause "Simplified" License
7.04k stars 786 forks source link

Fails to parse access to import.meta #2108

Closed ghost closed 2 years ago

ghost commented 2 years ago

The import.meta is used to get import.meta.url in JS generated by wasm-pack. Some webpack plugins (like gas-webpack-plugin of @fossamagna) use esprima and can not be added because that error.

Steps to reproduce

esprima.parse(`
f () {
  return import.meta.url;
}
`)

Relevant references

ghost commented 2 years ago

I found the ´esprima.parseModule´ in the doc, then I move the issue to gas-webpack-plugin.