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

minify.format.ascii_only results in invalid escape sequences #8260

Closed
mischnic opened this issue Nov 10, 2023 · 1 comment · Fixed by #8287
Closed

minify.format.ascii_only results in invalid escape sequences #8260

mischnic opened this issue Nov 10, 2023 · 1 comment · Fixed by #8287
Assignees
Labels
Milestone

Comments

@mischnic
Copy link
Contributor

Describe the bug

Sometimes ascii_only results in invalid escape sequences.

Input code

function p(µ, σ) {}
console.log(p);

Config

{
  "jsc": {
    "parser": {
      "syntax": "ecmascript",
      "jsx": false
    },
    "target": "es5",
    "loose": false,
    "minify": {
      "compress": false,
      "mangle": false,
      "format": {
        "ascii_only": true
      }
    },
  },
  "module": {
    "type": "es6"
  },
  "minify": false,
  "isModule": true
}

Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.3.94-nightly-20231016.1&code=H4sIAAAAAAAAA0srzUsuyczPUyjQOLRVR%2BF8s6ZCdS1Xcn5ecX5Oql5OfrpGgaY1AJi68IYlAAAA&config=H4sIAAAAAAAAA2WPSw7DIAxE9z1F5HW37aJ36BkqizoRET%2FZRGoU5e4FAkmqbhC8GY%2BH5dJ1MIqCR7eka3oEZCHe34nI7CJ%2BEgFSFkWxDhGuTR0lSz0aoYLWTYGIPFAsU3KrdjDeCzV7ZVY73c%2FnhcrbwCTya8xWdIOhP9x7thhPCYmlnlq%2FvDM5OfJEVVqPkuUA699Tyaz%2Fj3OgrfUdDlPruC8GLc82WeLXLxV2OoFLAQAA

SWC Info output

No response

Expected behavior

Output valid JS

Actual behavior

function p(\xb5, \u03C3) {}
console.log(p);

Version

1.3.94-nightly-20231016.1

Additional context

parcel-bundler/parcel#9370

@mischnic mischnic added the C-bug label Nov 10, 2023
@kdy1 kdy1 added this to the Planned milestone Nov 10, 2023
@kdy1 kdy1 self-assigned this Nov 10, 2023
kdy1 added a commit that referenced this issue Nov 16, 2023
@kdy1 kdy1 modified the milestones: Planned, v1.3.98 Nov 21, 2023
@swc-bot
Copy link
Collaborator

swc-bot commented Dec 21, 2023

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 Dec 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

3 participants