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

Signed integer key becomes just number with compress #6528

Closed
hyp3rflow opened this issue Nov 28, 2022 · 1 comment · Fixed by #6529
Closed

Signed integer key becomes just number with compress #6528

hyp3rflow opened this issue Nov 28, 2022 · 1 comment · Fixed by #6529
Labels
Milestone

Comments

@hyp3rflow
Copy link
Sponsor Contributor

Describe the bug

Signed integer key becomes just number with compress option

Input code

const foo = {
    "+1": 1,
    "2": 2,
    "-3": 3,
}

console.log(foo[1]);
console.log(foo["+1"]);
console.log(foo["2"]);
console.log(foo[2]);
console.log(foo[-3]);
console.log(foo["-3"]);

Config

No response

Playground link

https://play.swc.rs/?version=1.3.20&code=H4sIAAAAAAAAA0vOzysuUUjLz1ewVajmUgACJW1DJSsFQx0IxwjINoKydY2BHGMdrlourmSgtvycVL2c%2FHQNoOZow1hNawxBkElYxY2wChthE9Q1xmoC0ClAcQDkBt2EvQAAAA%3D%3D&config=H4sIAAAAAAAAA0WNwQ7DIAxD%2FyXnXrdD%2F2EfgVhaMUFBcSoNIf59oaLazbGd50YfeFobFSdgGQr1UPellbQWhpdQlBZSmLW5CO52ONlZrcJ4WBZzBs90oRSOsNVB8jkVYcC0PSV37PGu9WHk9zmMdi1dtCf1P2DyAl6zqHJy%2FwHpAZTksgAAAA%3D%3D

Expected behavior

const foo = {
"+1": 1,
2: 2,
-3: 3,
}

Actual behavior

const foo = {
1: 1,
2: 2,
"-3": 3,
}

Version

~ 1.3.20

Additional context

No response

@kdy1 kdy1 added this to the Planned milestone Nov 28, 2022
kdy1 pushed a commit that referenced this issue Nov 29, 2022
@kdy1 kdy1 modified the milestones: Planned, v1.3.21 Nov 30, 2022
@swc-bot
Copy link
Collaborator

swc-bot commented Dec 30, 2022

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 30, 2022
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