acornjs / acorn-jsx

Alternative, faster React.js JSX parser
MIT License
651 stars 74 forks source link

acorn-loose with jsx plugin #135

Open jasonhocker opened 2 years ago

jasonhocker commented 2 years 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?