acornjs / acorn-jsx

Alternative, faster React.js JSX parser
MIT License
648 stars 72 forks source link

acorn-loose with jsx plugin #135

Open jasonhocker opened 1 year ago

jasonhocker commented 1 year ago

I am trying to switch from acorn to acorn-loose. When I add the jsx plugin I get an error.

const ast = acorn.LooseParser.extend(jsx()).parse(code, { ecmaVersion: "latest", sourceType: "module" });

TypeError: this.curContext is not a function at LooseParser.readToken at LooseParser.next at LooseParser.parse at Function.parse

Is this an issue with the jsx plugin or acorn-loose? Or do I need to do more to enable these to work together?