Skip to content

handle all type of symbols as legal js literal#81

Merged
sindresorhus merged 1 commit into
sindresorhus:mainfrom
GHolk:symbol-literal
Sep 7, 2025
Merged

handle all type of symbols as legal js literal#81
sindresorhus merged 1 commit into
sindresorhus:mainfrom
GHolk:symbol-literal

Conversation

@GHolk

@GHolk GHolk commented Aug 13, 2023

Copy link
Copy Markdown
Contributor
  • well-known symbol are format like Symbol.iterator
  • global registried symbol are format like Symbol.for('name')
  • other symbol are format like Symbol('unique symbol')

close #80.

@GHolk

GHolk commented Aug 13, 2023

Copy link
Copy Markdown
Contributor Author

Test fail because xo fail. I don't know xo, and it failed on the original branch on my pc too.
But npx ava pass, and I fix and add a test case for all symbol types.

I saw a old pr #34 about symbol, but it is only partial support, and the output is illegal js.

* well-known symbol are format like `Symbol.iterator`
* global registried symbol are format like `Symbol.for('name')`
* other symbol are format like `Symbol('unique symbol')`
@sindresorhus
sindresorhus merged commit 1802836 into sindresorhus:main Sep 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support symbol literal

2 participants