Repository: swc-project/swc (rust)

Issue:
Arrow Function Syntax is still Exist After Converting to ES5 Syntax
### Describe the bug

When I convert an arrow function syntax, it fails to convert, there is still an arrow function in the result code.
At the seventh line of the output code.

### Input code

```typescript
function f0() {
}
f0.prototype = {
    name: 'Nicholas',
    age: 29,
    job: 'Software Engineer',
    sayName() {
        v0[args](1, {
            v9: v7 => super.v3(v27),
            foo: a,
            done: 'a'
        });
    }
};
```


### Config

```json
{
  "jsc": {
    "parser": {
      "syntax": "ecmascript",
      "jsx": false
    },
    "target": "es5",
    "loose": false,
    "minify": {
      "compress": false,
      "mangle": false
    }
  },
  "module": {
    "type": "es6",
    "strict": false,
    "strictMode": false,
    "lazy": false,
    "noInterop": false
  },
  "minify": false
}
```


### Playground link

https://play.swc.rs/?version=1.2.158&code=H4sIAAAAAAAAA1WOwQ6CMAyG7zxFb0BCCOKBAMGbVy4ejYeKG2J0JduYIWbv7pzEyH9qv35pyyfR6YEE8CyK4RXYgGfpKEmTnkcGjUPgIvDBKgjbobvSHVWYeIq9g3n5bW50dsaBuH6iZLAX%2FSAYk4uqcG7dDn8DlpjsiLJXp2iT%2FFE%2FKSswBTQ7UNPIZGq2kcmLOFlJnKgCXLMLic%2BfGP6ojWtf28DWb7HJBRDtAAAA&config=H4sIAAAAAAAAA22QwU7DMAyG3yXnXbnsxgQTkyjvYKUuZErsyHZHy8S7z2VTwxAnx5%2Ft3398DkeNYXsOFURRlpfOZDCFbcBYQKOkamHjbY4GyIqb0M8EJcVDqSy20irpBIYd2gf3Kx1GipaYdokaxGmZfMIBxmx74fKn8gYFtULEu1qPkQWMRf9BOxxY8Hm6s2RcX%2FGE%2BfETUqPpx7f7hBv69k4BUlfwbTTm7ADkHW25gj749zOz4i%2BXhkKQXzBXXO24TOF%2BzLhc0ebqMUQuhemoLqEmKTYX17Tjvslm%2BJrXhPhAvoVrU0%2Fa3fSv5AIhCjW1vQEAAA%3D%3D

### Expected behavior

Arrow function syntax can be converted successfully in my code.

### Actual behavior

_No response_

### Version

1.2.158

### Additional context

_No response_

Pull request:
fix(es/transforms/compat): visit non method prop in nested object literal
<!-- 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:**

<!-- 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):**
closes #4088 

Patch:
diff --git a/crates/swc_ecma_preset_env/src/lib.rs b/crates/swc_ecma_preset_env/src/lib.rs
index 1495e4e548..ebceac3301 100644
--- a/crates/swc_ecma_preset_env/src/lib.rs
+++ b/crates/swc_ecma_preset_env/src/lib.rs
@@ -193,6 +193,7 @@ where
         es2015::spread(es2015::spread::Config { loose }),
         true
     );
+    let pass = add!(pass, ObjectSuper, es2015::object_super());
     let pass = add!(pass, FunctionName, es2015::function_name());
     let pass = add!(pass, ArrowFunctions, es2015::arrow());
     let pass = add!(pass, DuplicateKeys, es2015::duplicate_keys());
diff --git a/crates/swc_ecma_transforms_compat/src/es2015/object_super.rs b/crates/swc_ecma_transforms_compat/src/es2015/object_super.rs
index 646f1b9227..e8589534bb 100644
--- a/crates/swc_ecma_transforms_compat/src/es2015/object_super.rs
+++ b/crates/swc_ecma_transforms_compat/src/es2015/object_super.rs
@@ -135,8 +135,17 @@ impl VisitMut for SuperReplacer {
     fn visit_mut_object_lit(&mut self, obj: &mut ObjectLit) {
         for prop_or_spread in obj.props.iter_mut() {
             if let PropOrSpread::Prop(prop) = prop_or_spread {
-                if let Prop::Method(MethodProp { key, function: _ }) = &mut **prop {
-                    key.visit_mut_with(self);
+                match &mut **prop {
+                    Prop::Method(MethodProp { key, .. })
+                    | Prop::Getter(GetterProp { key, .. })
+                    | Prop::Setter(SetterProp { key, .. }) => key.visit_mut_with(self),
+                    Prop::KeyValue(KeyValueProp { key, value }) => {
+                        key.visit_mut_with(self);
+                        if !(value.is_fn_expr() || value.is_class()) {
+                            value.visit_mut_with(self)
+                        }
+                    }
+                    Prop::Shorthand(_) | Prop::Assign(_) => (),
                 }
             }
         }


Test patch:
diff --git a/crates/swc_ecma_transforms_compat/tests/es2015_object_super.rs b/crates/swc_ecma_transforms_compat/tests/es2015_object_super.rs
index 31fb28f1d4..0ca9be72e6 100644
--- a/crates/swc_ecma_transforms_compat/tests/es2015_object_super.rs
+++ b/crates/swc_ecma_transforms_compat/tests/es2015_object_super.rs
@@ -30,7 +30,7 @@ test!(
       
     const obj = {
         test: 2,
-      
+
         get() {
             return super.test;
         },
@@ -202,3 +202,41 @@ test!(
     };
     Object.setPrototypeOf(obj, Base);"#
 );
+
+test!(
+    syntax(),
+    |_| tr(),
+    nested_object,
+    r#"
+function f0() {
+}
+f0.prototype = {
+    name: 'Nicholas',
+    age: 29,
+    job: 'Software Engineer',
+    sayName() {
+        v0[args](1, {
+            v9: v7 => super.v3(v27),
+            foo: a,
+            done: 'a'
+        });
+    }
+};
+"#,
+    r#"
+var _obj;
+function f0() {}
+f0.prototype = _obj = {
+    name: "Nicholas",
+    age: 29,
+    job: "Software Engineer",
+    sayName: function sayName() {
+        v0[args](1, {
+            v9: (v7)=>_get(_getPrototypeOf(_obj), "v3", this).call(this, v27),
+            foo: a,
+            done: "a"
+        });
+    }
+};    
+"#
+);