Repository: swc-project/swc (rust)

Issue:
RuntimeError: unreachable
### Describe the bug

Has this question fixed？I can still reproduce. https://github.com/swc-project/swc/issues/3432

### Input code

```typescript
const student = {
    name: "Tom",
    age = 12
};
```


### Config

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


### Playground link (or link to the minimal reproduction)

https://play.swc.rs/?version=1.5.24&code=H4sIAAAAAAAAA1NIzs8rLlEoLilNSc0rUbBVqOZSAIK8xNxUKwWlkPxcJR2wQGJ6KlDS0Iir1poLALz%2FENo0AAAA&config=H4sIAAAAAAAAA1WQSw6DIBCG957CzNptu%2BgdPMSEjgYjQmYgKTHevYBg647%2FxRfYu74HsYEVjegEXr3nQEN2F1FJ7umYhEMW4kvnUdw8fpIDpAyKYu08DC1dJEcTrkLFOs4EPPJMvqzkUeuwWivU6tUzetNT%2FAcqaxyTyL2Yq7jNK91xXUWCse9QwvoQHx2d%2BCf8Sg12XQxaxrbMP9IdXxGEbB4qAQAA

### SWC Info output

_No response_

### Expected behavior

Babel's behavior:

https://babeljs.io/repl#?browsers=chrome%2030&build=&builtIns=false&corejs=3.21&spec=false&loose=true&code_lz=MYewdgzgLgBNCuATApmWBeGBvAUDfMYAhgLbIBcMARACoglUA0eBRA5sjJgIwBMOAXwDcOIA&debug=false&forceAllTransforms=false&modules=false&shippedProposals=false&circleciRepo=&evaluate=false&fileSize=false&timeTravel=false&sourceType=module&lineWrap=true&presets=env&prettier=false&targets=&version=7.24.6&externalPlugins=&assumptions=%7B%7D

### Actual behavior

got "RuntimeError: unreachable"

### Version

1.5.24

### Additional context

_No response_

Pull request:
fix(es/es2015): Remove needless `unreachable!`
**Description:**


**Related issue:**

 - Closes #9020

Patch:
diff --git a/crates/swc_ecma_compat_es2015/src/duplicate_keys.rs b/crates/swc_ecma_compat_es2015/src/duplicate_keys.rs
index 55d29f96f5..d25e350979 100644
--- a/crates/swc_ecma_compat_es2015/src/duplicate_keys.rs
+++ b/crates/swc_ecma_compat_es2015/src/duplicate_keys.rs
@@ -64,7 +64,7 @@ impl VisitMut for PropFolder {
                 }
             }
 
-            Prop::Assign(..) => unreachable!("assign property in object literal is invalid"),
+            Prop::Assign(..) => {}
 
             Prop::Getter(..) => prop.visit_mut_children_with(&mut PropNameFolder {
                 props: &mut self.getter_props,


Test patch:
diff --git a/crates/swc/tests/fixture/issues-9xxx/9020/input/.swcrc b/crates/swc/tests/fixture/issues-9xxx/9020/input/.swcrc
new file mode 100644
index 0000000000..daa38ba90c
--- /dev/null
+++ b/crates/swc/tests/fixture/issues-9xxx/9020/input/.swcrc
@@ -0,0 +1,19 @@
+{
+    "jsc": {
+        "parser": {
+            "syntax": "ecmascript",
+            "jsx": false
+        },
+        "target": "es5",
+        "loose": false,
+        "minify": {
+            "compress": false,
+            "mangle": false
+        }
+    },
+    "module": {
+        "type": "es6"
+    },
+    "minify": false,
+    "isModule": true
+}
\ No newline at end of file
diff --git a/crates/swc/tests/fixture/issues-9xxx/9020/input/1.js b/crates/swc/tests/fixture/issues-9xxx/9020/input/1.js
new file mode 100644
index 0000000000..3c603ffe37
--- /dev/null
+++ b/crates/swc/tests/fixture/issues-9xxx/9020/input/1.js
@@ -0,0 +1,4 @@
+const student = {
+    name: "Tom",
+    age = 12
+};
\ No newline at end of file
diff --git a/crates/swc/tests/fixture/issues-9xxx/9020/output/1.js b/crates/swc/tests/fixture/issues-9xxx/9020/output/1.js
new file mode 100644
index 0000000000..4888edd2fa
--- /dev/null
+++ b/crates/swc/tests/fixture/issues-9xxx/9020/output/1.js
@@ -0,0 +1,4 @@
+var student = {
+    name: "Tom",
+    age=12
+};