Skip to content
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

How to keep ascii string output #8863

Closed
noyobo opened this issue Apr 15, 2024 · 3 comments
Closed

How to keep ascii string output #8863

noyobo opened this issue Apr 15, 2024 · 3 comments
Labels
Milestone

Comments

@noyobo
Copy link

noyobo commented Apr 15, 2024

Describe the bug

swc repl

pattern="\x5cd" output pattern="\\d"

Rollup repl

pattern="\x5cd" output pattern="\x5cd"

Although their syntax is equivalent in js, my running program relies on the ascii code of \x5c

When I used swc to replace the rollup project, the program ran unexpectedly.

Input code

No response

Config

No response

Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.3.100&code=H4sIAAAAAAAAA0soSCwpSS3Ks1WKqTBNTlFKsAYAQ6376BIAAAA%3D&config=H4sIAAAAAAAAA1WPSw7DIAwF9zkF8rrbdtE79BCIOhERP9mOVBTl7oUE0maH3xszsA5KwcwGnmotxzIkTYx0ziXhHER%2FSgKSE7IhmwRuvRWu1agd4x5tRwOiaUKpW8j3hoOLkbHjLfM22DH%2FC030iZD5ClZUh8nhVTc0Jfj4XvayfaQ%2B9tA%2F4Ad12XkxWH71TaEFh%2B0LYuVI0xQBAAA%3D

SWC Info output

No response

Expected behavior

keep ascii code

Actual behavior

No response

Version

14.14

Additional context

No response

@kdy1
Copy link
Member

kdy1 commented Apr 18, 2024

Did you read documentation in swc.rs?

@kdy1
Copy link
Member

kdy1 commented Apr 18, 2024

If you are using swc via rollup, there's ascii_only

https://rustdoc.swc.rs/swc_ecma_codegen/struct.Config.html

@swc-bot
Copy link
Collaborator

swc-bot commented May 18, 2024

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.

@swc-project swc-project locked as resolved and limited conversation to collaborators May 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants