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

1.3.98 swc minify breaks property name with non-ascii char when asciiOnly is on #8491

Closed
xc2 opened this issue Jan 9, 2024 · 2 comments · Fixed by #8493 or #8519
Closed

1.3.98 swc minify breaks property name with non-ascii char when asciiOnly is on #8491

xc2 opened this issue Jan 9, 2024 · 2 comments · Fixed by #8493 or #8519
Assignees
Labels
Milestone

Comments

@xc2
Copy link
Contributor

xc2 commented Jan 9, 2024

Describe the bug

when asciiOnly is on, swc minify emits invalid property name which is original unicode.

works fine with 1.3.97 but 1.3.98

Input code

const a = {aób: 'ó'}

console.log(a)

Config

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

Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.3.98&code=H4sIAAAAAAAAA0vOzysuUUhUsFWoTjy8OclKQf3wZvVaLq5koHh%2BTqpeTn66RqImAJ8BdbomAAAA&config=H4sIAAAAAAAAA02PMQ7DIAxF95wi8ty1HXqHqmdA1KmIICDbkYqi3L0OgSSLZb%2F%2FjT9L1%2FcwsoVnv2irQzLESMeshPMk5qcE0AbDllwSuDV15E0ajGcsaN0VEENflLLF92oHHyNjs1cW3OSGfD1oY0iEzMqEZjxODZGCkYtTmeZx7j35XM1VWbtWSx4I8TN7PH8pOeGe7QGnqSU54oHjV9ssr69%2FIxZbWDEBAAA%3D

SWC Info output

No response

Expected behavior

console.log({
    "a\xf3b": "\xf3"
});

Actual behavior

console.log({
    a\xf3b: "\xf3"
});

Version

1.3.98

Additional context

No response

@kdy1 kdy1 reopened this Jan 19, 2024
@kdy1 kdy1 modified the milestones: v1.3.103, Planned Jan 19, 2024
kdy1 added a commit that referenced this issue Jan 19, 2024
**Description:**

The issue was fixed by #8493, but it was not included in the latest release because of the wrong bump comment.

**Related issue:**

 - Closes #8491
@kdy1 kdy1 modified the milestones: Planned, v1.3.105 Jan 21, 2024
@swc-bot
Copy link
Collaborator

swc-bot commented Feb 20, 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 Feb 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.