TyrealHu / acorn-typescript

Alternative, TypeScript parser
https://www.npmjs.com/package/acorn-typescript?activeTab=readme
MIT License
145 stars 18 forks source link

SyntaxError: Unexpected token at destructured and typed argument list of arrow function declaration #39

Closed bpstrngr closed 1 year ago

bpstrngr commented 1 year ago

parsed file: rollup/src/utils/pureFunctions.ts

export const getPureFunctions = ({ treeshake }: NormalizedInputOptions): PureFunctions => {};
                                                                      ^
SyntaxError: Unexpected token (10:71)
    at pp.raise (file:///mnt/chromeos/GoogleDrive/MyDrive/blik/haverbeke_2012_acorn/0/acorn/src/location.js:15:13)
    at TypeScriptParser.raiseCommonCheck (file:///mnt/chromeos/GoogleDrive/MyDrive/blik/tyrealhu_2023_acorn_typescript.js:4990:44)
    at TypeScriptParser.raise (file:///mnt/chromeos/GoogleDrive/MyDrive/blik/tyrealhu_2023_acorn_typescript.js:4996:29)
    at pp.unexpected (file:///mnt/chromeos/GoogleDrive/MyDrive/blik/haverbeke_2012_acorn/0/acorn/src/parseutil.js:111:8)
    at pp.semicolon (file:///mnt/chromeos/GoogleDrive/MyDrive/blik/haverbeke_2012_acorn/0/acorn/src/parseutil.js:88:59)
    at TypeScriptParser.parseVarStatement (file:///mnt/chromeos/GoogleDrive/MyDrive/blik/tyrealhu_2023_acorn_typescript.js:3520:22)
    at pp.parseStatement (file:///mnt/chromeos/GoogleDrive/MyDrive/blik/haverbeke_2012_acorn/0/acorn/src/statement.js:116:17)
    at TypeScriptParser.parseStatement (file:///mnt/chromeos/GoogleDrive/MyDrive/blik/tyrealhu_2023_acorn_typescript.js:3568:30)
    at TypeScriptParser.parseExport (file:///mnt/chromeos/GoogleDrive/MyDrive/blik/xtuc_2020_acorn_importassertions/0/src/index.js:101:33)
    at TypeScriptParser.parseExport (file:///mnt/chromeos/GoogleDrive/MyDrive/blik/tyrealhu_2023_acorn_typescript.js:3392:34) {
  pos: 296,
  loc: Position { line: 10, column: 71 },
  raisedAt: 297
}
TyrealHu commented 1 year ago

fixed in version 1.4.4