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

asciiOnly: true results in invalid escape code inside identifier #8852

Closed
mischnic opened this issue Apr 12, 2024 · 1 comment · Fixed by #8866
Closed

asciiOnly: true results in invalid escape code inside identifier #8852

mischnic opened this issue Apr 12, 2024 · 1 comment · Fixed by #8866
Assignees
Labels
Milestone

Comments

@mischnic
Copy link
Contributor

mischnic commented Apr 12, 2024

Describe the bug

asciiOnly: true results in invalid escape code inside identifier

Input code

const módulo = 123;
console.log(módulo);

Config

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

Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.4.14-nightly-20240411.1&code=H4sIAAAAAAAAA0vOzysuUcg9vDmlNCdfwVbB0MjYmisZKJifk6qXk5%2BuAZXStAYATd5jRSoAAAA%3D&config=H4sIAAAAAAAAA2VQSwqDQAzde4oh6%2B4KXfQO0jMM01hG5kcSoSLevePoqMVd8j55j0yNUtCzgaea8piXpImR9j0jPAbR34wAGq%2FZkE0Ct8r2vFCddowFmlcGRNMHpbj4vsnBxchY5fVExr0NthtPoRtuok%2BEzFdLobtIXsvFVrhc1NpXcMtVoQH%2FFHNznkpl8PE9ODweIWPCtf4DDlEtutcBy211lpz5B8lC%2FqlUAQAA

SWC Info output

No response

Expected behavior

Output valid JS

Actual behavior

Invalid JS:

var m\xf3dulo = 123;
console.log(m\xf3dulo);

Version

1.4.14-nightly-20240411.1

Additional context

Coming from parcel-bundler/parcel#9632

@mischnic mischnic added the C-bug label Apr 12, 2024
@kdy1 kdy1 self-assigned this Apr 12, 2024
@kdy1 kdy1 added this to the Planned milestone Apr 12, 2024
kdy1 added a commit that referenced this issue Apr 16, 2024
@kdy1 kdy1 modified the milestones: Planned, v1.4.15 Apr 17, 2024
@swc-bot
Copy link
Collaborator

swc-bot commented May 17, 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 17, 2024
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