Repository: swc-project/swc (rust)

Issue:
Signed integer key becomes just number with `compress`
### Describe the bug

Signed integer key becomes just number with `compress` option

### Input code

```typescript
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_

Pull request:
fix(es/minifier): Fix not to convert signed integer literal key to numeric one.
<!-- Note: CI script will automatically rebase your PR so please do not rebase unless required -->

<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. -->

**Description:** fix not to convert key when it is started with '+'

<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->

**BREAKING CHANGE:**

<!--
If this PR introduces a breaking change, it must contain a notice for it to be included in the CHANGELOG. Add description or remove entirely if not breaking.

You may need to update `MIGRATION.md` for the breaking changes.
-->

**Related issue (if exists):** resolve #6528 


Patch:
diff --git a/crates/swc_ecma_minifier/src/compress/pure/properties.rs b/crates/swc_ecma_minifier/src/compress/pure/properties.rs
index 2a7bad6b56..2388f6debf 100644
--- a/crates/swc_ecma_minifier/src/compress/pure/properties.rs
+++ b/crates/swc_ecma_minifier/src/compress/pure/properties.rs
@@ -95,7 +95,7 @@ impl Pure<'_> {
                 return;
             }
 
-            if !s.value.starts_with('0') || s.value.len() <= 1 {
+            if (!s.value.starts_with('0') && !s.value.starts_with('+')) || s.value.len() <= 1 {
                 if let Ok(v) = s.value.parse::<u32>() {
                     self.changed = true;
                     report_change!("misc: Optimizing numeric property name");


Test patch:
diff --git a/crates/swc_ecma_minifier/tests/exec.rs b/crates/swc_ecma_minifier/tests/exec.rs
index 5508fa9fc6..a00ad7941c 100644
--- a/crates/swc_ecma_minifier/tests/exec.rs
+++ b/crates/swc_ecma_minifier/tests/exec.rs
@@ -10374,3 +10374,23 @@ fn issue_6463_1() {
         "###,
     );
 }
+
+#[test]
+fn issue_6528() {
+    run_default_exec_test(
+        r###"
+        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"]);
+        "###,
+    )
+}