-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Incorrect compilation of Object Literal with Special Characters #8940
Comments
@kdy1 Can you point me to where you're dropping the quotes? I want to check whether it's using the correct functions or not. |
swc/crates/swc_ecma_minifier/src/compress/pure/properties.rs Lines 84 to 96 in 6d7b99b
|
I found part of the problem: U+30FB was added to I spent 2 hours searching for all the missing pieces, I give up. Let me back port unicode version 14. |
@kdy1 Can you change and pin the version (perhaps with the comment as well so we are clear which version of unicode we are targeting.)
|
**Description:** #8940 (comment) > I found part of the problem: > > U+30FB was added to `ID_Continue` from Unicode version 14 to 15, but v8 is using an older version of unicode ... which I can't find the exact version. > > I spent 2 hours searching for all the missing pieces, I give up. > > Let me back port unicode version 14. **Related issue:** - Closes #8940
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Describe the bug
Since version 1.4.12, when constructing an object containing keys with special characters such as "
・
" (U+30FB KATAKANA MIDDLE DOT), it will be converted to a format with no quotes.This leads to a "Uncaught SyntaxError: Invalid or unexpected token" error during execution.
Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.4.12&code=H4sIAAAAAAAAA0vOzyvOz0nVy8lP16jmUlBQetzYpGSlYKgDZT9u3o0igsFFUwzh1moCABZnot9YAAAA&config=H4sIAAAAAAAAA32UO5LbMAxA%2Bz2FR3XapMgBtssZODQJytxQhIYAvdbs%2BO4BJfmTNaROwsOP%2BH29HQ7dB7nu9%2BFLPuVntIWg3P9FQlNmexFJx9MI5Eocuftxo0wNBZsIZtF1IR3b0gM3K6Cfq3qXEAlu6qtsiDmG6Tmgw2EsQPQkE6n4qwNkpv%2FtV1bwswEu9Vl%2BRExg8w4xlkzMDD0UzbHDlOxIYM62KF5aprZEQi1Eg5XBm7HgqPLsI0fMEvOVerDeOPSgoFjAcTyDZiaxxCyTPE95z4w9HGvfz03%2BZg1nm6plJSZc5pZItorXE0ZiE2rWSrjAjRoscC3ud8sYTAGuJb%2FafWDMGz35CyAVSJYo2wE0v7NGkHnasg67ljEHGVmeFC7zrb0yQy9FNTEGpbKtMlA4at0s4KuDVlmnpbPijfJR9GAgBJkVxTV9RnYnLWjbcgwKkP7aoE3VAsx9Czd4W4gd%2FC6vZH3AVo3B8mmb0jQcMe0EGIBP6HcUpBWM27jIlbiM27xmDzIa4FWVSjN4PQKyAIwmzcfyZTZkPcSj6RMeH2diVbjej%2FBgc%2F%2FY9%2BUOv60K3YC%2BznC98K2%2Fy13%2B1T2Ublf4nngX6c%2FNcg56%2FQckCXpSLQYAAA%3D%3D
SWC Info output
No response
Expected behavior
Actual behavior
Version
Version 1.4.12 and above
Additional context
No response
The text was updated successfully, but these errors were encountered: