Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Error with opening paren in JSDoc for function binding #15016

Closed
ota-meshi opened this issue Jan 15, 2025 · 0 comments · Fixed by #15020
Closed

Error with opening paren in JSDoc for function binding #15016

ota-meshi opened this issue Jan 15, 2025 · 0 comments · Fixed by #15020

Comments

@ota-meshi
Copy link
Member

Describe the bug

If we write JSDoc for a getter using function binding and include an opening paren (, parsing will fail.

<input bind:value={
	/** ( */
	() => value,
	(v) => value = v.toLowerCase()}
/>

Reproduction

https://svelte.dev/playground/hello-world?version=5.17.5#H4sIAAAAAAAAE22MTQrCMBCFrzLMxraUdh_bgrhx4Q2Mi2pHCMRJSKatUnp3iSJu3L33vZ8Fub8TKjyQtQ5mF-wAGQ1GaMixxJuxFFGdFpSnT70EsPyudt5XcSIriV36SP_41bEQS0SFTbwG46XTrMWSwNTbkaCFzWarual_KTeG_ShwMTyod6td0qguCsigqJPOcmi7z0X59tMPQAtTJe7oZgr7PlKWr5rrTjOWKPQQVBJGWs_rC_ImaUkBAQAA

Logs

Expected token )
https://svelte.dev/e/expected_token
https://svelte.dev/e/js_parse_error

System Info

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M3
    Memory: 141.58 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.4.1 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.8.1 - /usr/local/bin/npm
    pnpm: 9.12.3 - /usr/local/bin/pnpm
  Browsers:
    Chrome: 131.0.6778.265
    Chrome Canary: 121.0.6124.0
    Safari: 17.4.1
  npmPackages:
    svelte: ^5.9.0 => 5.17.4

Severity

annoyance

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant