You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// both used by svelte according to the repo's lockfileimport*asacornfrom"npm:acorn@8.12.1";importtsPluginfrom"npm:acorn-typescript@1.4.13";constnode=acorn.Parser.extend(tsPlugin({allowSatisfies: true})).parse("const f = (...args: any) => {}",{sourceType: "module",ecmaVersion: 13,locations: true,});console.log(node);
Produces the same error. But the problem is fixed when using acorn@8.14.0
Describe the bug
I'm trying to define an async function with rest parameters in a Svelte component using TypeScript:
Svelte's parser throws an "Unexpected token" error when trying to parse the rest parameters syntax:
Reproduction
https://svelte.dev/playground/hello-world?version=5.20.0#H4sIAAAAAAAAE3WRTWvDMAyG_4owOyQQsntIArvtsEMZudU9qInSGVy5WOraUPLfh9ePrfu4ydL7SK_kk2HckqnMM3kf4BCiHyCjwSkNuSnM6DyJqZYno9Mu6VLCFFfqabcr5Z28ptwahf7K94GVWMVUppY-up2CR9401qhY01ruA4vCCA2gTNxDVpYlxo1UgDzl0LRwsmzV8my5fjy3aC1bNoVROqqpNO5pLv4xqSR6cVOq3Bv9Vftm1qonBR9wcLwRaOBBFJXqV-pDHGrR6HhTwDoET8htm53m3DLAuOdeXWA4OH17OeN1B3RU4kHut1uuPvdbxLB1QjXy1LZZagIwcgVdcY7dUH3jFhhxS0pR6q795C9ekjivoEv3Slgk3UeG7OdZfze4AHBbd-mGqz5fQQPpwleNxukLuE3BAzqFkW_YVTHD6Bi9v4P-mzOil9ug-RzMOaBAlx7z_Zev5g-1TUS9wQIAAA==
Logs
System Info
System: OS: macOS 15.2 CPU: (12) arm64 Apple M2 Max Memory: 3.30 GB / 64.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.14.0 - /usr/local/bin/node npm: 10.9.2 - /usr/local/bin/npm pnpm: 10.3.0 - /usr/local/bin/pnpm bun: 1.1.6 - ~/.bun/bin/bun Watchman: 2024.12.02.00 - /opt/homebrew/bin/watchman Browsers: Brave Browser: 131.1.73.105 Chrome: 133.0.6943.55 Safari: 18.2
Severity
annoyance
The text was updated successfully, but these errors were encountered: