-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compress optimize escape \\
in template string
#9184
Comments
hi @kdy1 could you plz give some hint about the problem, maybe i can make a PR |
Sorry. I missed your comment. GFI guideTesting
To make the test reliable, you would need to add let pi= Math.random() >1.1 ? "foo": "bar";
let fi=`(${`${pi}`} - ${`\\*${pi}`})`
console.log(fi) let pi= Math.random() < -0.1 ? "foo": "bar";
let fi=`(${`${pi}`} - ${`\\*${pi}`})`
console.log(fi) so the DebuggingI wrote the relevant documentation for debugging or testing to https://github.com/swc-project/swc/blob/e22f3ba9adf21eac057eab29284333b1631258b3/crates/swc_ecma_minifier/README.md#contributing FixingOnce you get the location of the relevant code, my guess is that you will need to modify some code about the string replacing logic. |
@kdy1 thanks for your guide. |
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
expect the output should be
(foo - \*foo)
or(bar - \*bar)
but
(foo - *foo)
or(bar - *bar)
Input code
Config
Playground link (or link to the minimal reproduction)
https://play.swc.rs/?version=1.6.7&code=H4sIAAAAAAAAA8tJLVEoyLRV8E0sydArSsxLyc%2FV0FSwM9AzU7BXUErLz1eyUlBKSixSsubKASpNy7RN0FCpTlCpLsisTahV0FUAcmJitKB8zQQuruT8vOL8nFS9nPx0jbRMTQD%2FL1pIYQAAAA%3D%3D&config=H4sIAAAAAAAAA32US47bMAyG9zlF4HUXg1kVPUB3PYOgSJSjVBINkcrEGOTupR%2FJpBM6O5sff1IiKX7u9vvuRK77tf%2BUT%2FkZbCWo93%2Bx0FjYXsTSgcuWXI0Ddz9u9EQTCjYRzKbrQjq2tQeeVfT%2B9v62KrqESHBTrLYcSwzjY06HeahA9GATq4RsGQrT%2F%2FqVVfyYANf2aD8gJrDlBTGWTCwMPVQtsMOU7EBgzrYqUaaT2hoJtRQTbAzeDBUHlRcfOWKRnM%2FUg%2FXGoQcFxQqO4xk0meQSWSG5nnKfGXs4tL6f%2B%2FxNDWebmmUlJ1zmlshplahHjMQmtKKVcIEbNVjgWtzvyhhMBW61POtOGMtGT%2F4CSAWSJSo2gxZ39ggyT1vq8FIZS5CR5VHhMt%2FaLQv0UlQTY1AqO1UGKketmxV8czBV1mnHWfFG%2BSh6MBCCzIoSmj4iu6OWlMcBMChA%2BmuDNlULMPdXuMGnB%2FEC%2F5Zbsj5gq0e2fNymNOYDphcJMvAR%2FQsHaQXjNq6yJS7DNm%2FFg4wGeNWl0Qyel4A8AEaT5n35NBvyPCSi6RMe1DUxyJzPTfy52q735Zxt6b%2BWwLKfd6tDl9G3Ga6bf2r6tK%2BlRxnLibovz9t%2Bvl%2Bpi%2FTnJp%2BOs7v%2BA6xLOoBKBgAA
SWC Info output
No response
Expected behavior
output
(foo - \*foo)
or(bar - \*bar)
Actual behavior
(foo - *foo)
or(bar - *bar)
Version
1.6.7
Additional context
No response
The text was updated successfully, but these errors were encountered: