Closed ota-meshi closed 1 year ago
The following code seems to give a syntax error when using acorn-typescript.
a = (x = 42) => {}
The following code is to reproduce.
import * as acorn from "acorn"; import { tsPlugin } from "acorn-typescript"; const acornTs = acorn.Parser.extend(tsPlugin()); const code = "a = (x = 42) => {}"; const options = { sourceType: "module", ecmaVersion: "latest", locations: true, } as const; // OK let node = acorn.Parser.parse(code, options); console.log(node); // Error node = acornTs.parse(code, options); console.log(node);
Use Versions:
"acorn": "^8.8.2", "acorn-typescript": "^1.2.7",
The following code seems to give a syntax error when using acorn-typescript.
The following code is to reproduce.
Use Versions: