Repository: swc-project/swc (rust)

Issue:
compression removes a function when called inside template literal
### Describe the bug

Just run code with compression enabled

### Input code
```typescript
function example(html) {
    const test = () => {
      return 'test';
    };
    return  html`${test()}`
}
```
### Output

```javascript
function example(html) {
    const test;
    return html`${test()}`;
}
```

### Config

```json
{
  "jsc": {
    "parser": {
      "syntax": "ecmascript",
      "jsx": false
    },
    "target": "es2021",
    "loose": false,
    "minify": {
      "compress": {
        "arguments": false,
        "arrows": false,
        "booleans": false,
        "booleans_as_integers": false,
        "collapse_vars": false,
        "comparisons": false,
        "computed_props": false,
        "conditionals": false,
        "dead_code": false,
        "directives": false,
        "drop_console": false,
        "drop_debugger": false,
        "evaluate": false,
        "expression": false,
        "hoist_funs": false,
        "hoist_props": false,
        "hoist_vars": false,
        "if_return": false,
        "join_vars": false,
        "keep_classnames": false,
        "keep_fargs": false,
        "keep_fnames": false,
        "keep_infinity": false,
        "loops": false,
        "negate_iife": false,
        "properties": false,
        "reduce_funcs": false,
        "reduce_vars": false,
        "side_effects": false,
        "switches": false,
        "typeofs": false,
        "unsafe": false,
        "unsafe_arrows": false,
        "unsafe_comps": false,
        "unsafe_Function": false,
        "unsafe_math": false,
        "unsafe_symbols": false,
        "unsafe_methods": false,
        "unsafe_proto": false,
        "unsafe_regexp": false,
        "unsafe_undefined": false,
        "unused": false
      },
      "mangle": false
    }
  },
  "module": {
    "type": "es6"
  },
  "minify": false,
  "isModule": true
}
```


### Playground link
[Playground](https://play.swc.rs/?version=1.2.111&code=H4sIAAAAAAAAA0srzUsuyczPU0itSMwtyEnVyCjJzdFUqOZSAILk%2FLziEoWSVCBhq6ChqWBrB5VQUChKLSktylNQB0mqW4MFayEUVEYBZFCCSjVIgYZmbQJXLRcAOdZ472wAAAA%3D&config=H4sIAAAAAAAAA22TTZLjIAyF7%2BJ1FtO9mEUfoHdzBoqAcNRjkAuJdFyp3H1E4raxPTv08Sw%2F%2FXDvvth1H%2FdutJkh1xNPSeyt%2B%2BjARcsu4yjdSWWKgh0YHqdObO5BqoTff72%2F6fVAxDALTl3EhGGqyRzFMQNzPetHJUISXnQ2Z%2FpewzPRADYdgbFsMAn0kNdLR8NgRwZztRsatRRkSltWBLwZM40tTh4FKWm4QA%2FWG0d%2BLcZjBid4hUakeVSUWO1toYdz6fvayJnC1Q7FyiqD27Mh%2BtsFXQhZTCiN5Rfa%2Bn2xTbUYTAYpec31RZi2mr8AanawzMlG2PGgQ9mj%2F8gwBR2pTAvVeTfOEvRaokEMa53VO2TBJlUGXxzUQt0BbiwzejAQgva9gd8o7tKkk2kECmus%2FbONgVdodjs207oSB%2FipxqQdzMyjlcue8RTPNBxSRJAL%2BQPWZgjtYdZ9vo17WpIHbTb45qLwEurrizb1y949KiBfKrg%2FW%2FJ8lr%2B7x%2FoMf5aF%2F8xCyQUe%2FwDEWf6R%2BwMAAA%3D%3D)

### Expected behavior

Function should stay

### Version

1.2.114

### Additional context

_No response_

Pull request description:
fix(es/minifier): Inline into interpolations in tagged template literals
<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. -->

**Description:**

swc_ecma_minifier:
 - Inline into tagged template literals. (Closes #2923)


**Related issue (if exists):**

 - Closes #2923

Patch:
diff --git a/crates/swc_ecma_minifier/src/compress/optimize/mod.rs b/crates/swc_ecma_minifier/src/compress/optimize/mod.rs
index ff13b64548..6b94713ecf 100644
--- a/crates/swc_ecma_minifier/src/compress/optimize/mod.rs
+++ b/crates/swc_ecma_minifier/src/compress/optimize/mod.rs
@@ -2122,17 +2122,6 @@ where
         }
     }
 
-    fn visit_mut_super_prop_expr(&mut self, n: &mut SuperPropExpr) {
-        if let SuperProp::Computed(c) = &mut n.prop {
-            let ctx = Ctx {
-                is_exact_lhs_of_assign: false,
-                is_lhs_of_assign: false,
-                ..self.ctx
-            };
-            c.visit_mut_with(&mut *self.with_ctx(ctx));
-        }
-    }
-
     fn visit_mut_module_items(&mut self, stmts: &mut Vec<ModuleItem>) {
         let ctx = Ctx {
             top_level: true,
@@ -2514,6 +2503,17 @@ where
         s.kind = Default::default()
     }
 
+    fn visit_mut_super_prop_expr(&mut self, n: &mut SuperPropExpr) {
+        if let SuperProp::Computed(c) = &mut n.prop {
+            let ctx = Ctx {
+                is_exact_lhs_of_assign: false,
+                is_lhs_of_assign: false,
+                ..self.ctx
+            };
+            c.visit_mut_with(&mut *self.with_ctx(ctx));
+        }
+    }
+
     fn visit_mut_switch_cases(&mut self, n: &mut Vec<SwitchCase>) {
         n.visit_mut_children_with(self);
 
@@ -2531,6 +2531,8 @@ where
     /// We don't optimize [Tpl] contained in [TaggedTpl].
     fn visit_mut_tagged_tpl(&mut self, n: &mut TaggedTpl) {
         n.tag.visit_mut_with(self);
+
+        n.tpl.exprs.visit_mut_with(self);
     }
 
     fn visit_mut_throw_stmt(&mut self, n: &mut ThrowStmt) {


Test patch:
diff --git a/crates/swc/tests/tsc-references/parenthesizedContexualTyping3_es2015.2.minified.js b/crates/swc/tests/tsc-references/parenthesizedContexualTyping3_es2015.2.minified.js
index 139fd9069d..2778ff45ac 100644
--- a/crates/swc/tests/tsc-references/parenthesizedContexualTyping3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/parenthesizedContexualTyping3_es2015.2.minified.js
@@ -14,4 +14,4 @@ tempFun`${(x)=>x
 } ${(x)=>x
 } ${10}`, tempFun`${(x)=>x
 } ${(x)=>x
-} ${undefined}`;
+} ${void 0}`;
diff --git a/crates/swc/tests/tsc-references/taggedTemplateContextualTyping1_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateContextualTyping1_es2015.2.minified.js
index b1ddb9743c..0de72851e5 100644
--- a/crates/swc/tests/tsc-references/taggedTemplateContextualTyping1_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/taggedTemplateContextualTyping1_es2015.2.minified.js
@@ -1,23 +1,16 @@
 function tempTag1(...rest) {}
 tempTag1`${(x)=>{
-    x(undefined);
-    return x;
+    return x(void 0), x;
 }}${10}`, tempTag1`${(x)=>{
-    x(undefined);
-    return x;
+    return x(void 0), x;
 }}${(y)=>{
-    y(undefined);
-    return y;
+    return y(void 0), y;
 }}${10}`, tempTag1`${(x)=>{
-    x(undefined);
-    return x;
+    return x(void 0), x;
 }}${(y)=>{
-    y(undefined);
-    return y;
-}}${undefined}`, tempTag1`${(x)=>{
-    x(undefined);
-    return x;
+    return y(void 0), y;
+}}${void 0}`, tempTag1`${(x)=>{
+    return x(void 0), x;
 }}${(y)=>{
-    y(undefined);
-    return y;
-}}${undefined}`;
+    return y(void 0), y;
+}}${void 0}`;
diff --git a/crates/swc/tests/tsc-references/taggedTemplateContextualTyping2_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateContextualTyping2_es2015.2.minified.js
index d7be5020d5..a6c9ad905e 100644
--- a/crates/swc/tests/tsc-references/taggedTemplateContextualTyping2_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/taggedTemplateContextualTyping2_es2015.2.minified.js
@@ -1,14 +1,10 @@
 function tempTag2(...rest) {}
 tempTag2`${(x)=>{
-    x(undefined);
-    return x;
+    return x(void 0), x;
 }}${0}`, tempTag2`${(x)=>{
-    x(undefined);
-    return x;
+    return x(void 0), x;
 }}${(y)=>{
-    y(null);
-    return y;
+    return y(null), y;
 }}${"hello"}`, tempTag2`${(x)=>{
-    x(undefined);
-    return x;
-}}${undefined}${"hello"}`;
+    return x(void 0), x;
+}}${void 0}${"hello"}`;
diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es2015.2.minified.js
index f0ca79cac6..26848254df 100644
--- a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInferenceES6_es2015.2.minified.js
@@ -9,13 +9,13 @@ function someGenerics9(strs, a, b, c) {
 }
 (function(n) {})``, (function(n) {})``, (function(n, m) {})`${3}`, (function(n, m) {})`${3}`, (function(strs, n) {})`${(n)=>n
 }`, (function(strs, n) {})`${(n, x)=>n
-}`, someGenerics3`${()=>''
-}`, someGenerics3`${()=>undefined
+}`, someGenerics3`${()=>""
+}`, someGenerics3`${()=>void 0
 }`, someGenerics3`${()=>3
 }`, someGenerics4`${4}${()=>null
-}`, someGenerics4`${''}${()=>3
+}`, someGenerics4`${""}${()=>3
 }`, someGenerics4`${null}${null}`, someGenerics5`${4} ${()=>null
-}`, someGenerics5`${''}${()=>3
+}`, someGenerics5`${""}${()=>3
 }`, someGenerics5`${null}${null}`, someGenerics6`${(n)=>n
 }${(n)=>n
 }${(n)=>n
@@ -36,16 +36,16 @@ function someGenerics9(strs, a, b, c) {
 }${(n)=>n
 }`, (function(strs, n) {
     return n;
-})`${someGenerics7}``${null}${null}${null}`, someGenerics9`${''}${0}${[]}`, someGenerics9`${undefined}${{
+})`${someGenerics7}``${null}${null}${null}`, someGenerics9`${""}${0}${[]}`, someGenerics9`${void 0}${{
     x: 6,
     z: new Date()
 }}${{
     x: 6,
-    y: ''
+    y: ""
 }}`, someGenerics9`${{
     x: 3
 }}${{
     x: 6
 }}${{
     x: 6
-}}`, someGenerics9`${7}${anyVar}${4}`, someGenerics9`${[]}${null}${undefined}`;
+}}`, someGenerics9`${7}${anyVar}${4}`, someGenerics9`${[]}${null}${void 0}`;
diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es2015.2.minified.js
index f0ca79cac6..26848254df 100644
--- a/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/taggedTemplateStringsTypeArgumentInference_es2015.2.minified.js
@@ -9,13 +9,13 @@ function someGenerics9(strs, a, b, c) {
 }
 (function(n) {})``, (function(n) {})``, (function(n, m) {})`${3}`, (function(n, m) {})`${3}`, (function(strs, n) {})`${(n)=>n
 }`, (function(strs, n) {})`${(n, x)=>n
-}`, someGenerics3`${()=>''
-}`, someGenerics3`${()=>undefined
+}`, someGenerics3`${()=>""
+}`, someGenerics3`${()=>void 0
 }`, someGenerics3`${()=>3
 }`, someGenerics4`${4}${()=>null
-}`, someGenerics4`${''}${()=>3
+}`, someGenerics4`${""}${()=>3
 }`, someGenerics4`${null}${null}`, someGenerics5`${4} ${()=>null
-}`, someGenerics5`${''}${()=>3
+}`, someGenerics5`${""}${()=>3
 }`, someGenerics5`${null}${null}`, someGenerics6`${(n)=>n
 }${(n)=>n
 }${(n)=>n
@@ -36,16 +36,16 @@ function someGenerics9(strs, a, b, c) {
 }${(n)=>n
 }`, (function(strs, n) {
     return n;
-})`${someGenerics7}``${null}${null}${null}`, someGenerics9`${''}${0}${[]}`, someGenerics9`${undefined}${{
+})`${someGenerics7}``${null}${null}${null}`, someGenerics9`${""}${0}${[]}`, someGenerics9`${void 0}${{
     x: 6,
     z: new Date()
 }}${{
     x: 6,
-    y: ''
+    y: ""
 }}`, someGenerics9`${{
     x: 3
 }}${{
     x: 6
 }}${{
     x: 6
-}}`, someGenerics9`${7}${anyVar}${4}`, someGenerics9`${[]}${null}${undefined}`;
+}}`, someGenerics9`${7}${anyVar}${4}`, someGenerics9`${[]}${null}${void 0}`;
diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithIncompatibleTypedTagsES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithIncompatibleTypedTagsES6_es2015.2.minified.js
index 1763a2652f..7acb15b5d2 100644
--- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithIncompatibleTypedTagsES6_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithIncompatibleTypedTagsES6_es2015.2.minified.js
@@ -1,2 +1,2 @@
 var f;
-f`abc`, f`abc${1}def${2}ghi`, f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`[0].member`abc${1}def${2}ghi`, f`abc${1}def${2}ghi`.member.member`abc${1}def${2}ghi`, f`abc${true}def${true}ghi`.member.member`abc${1}def${2}ghi`, f.thisIsNotATag("abc"), f.thisIsNotATag("abc1def2ghi");
+f`abc`, f`abc${1}def${2}ghi`, f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`[0].member`abc${1}def${2}ghi`, f`abc${1}def${2}ghi`.member.member`abc${1}def${2}ghi`, f`abc${!0}def${!0}ghi`.member.member`abc${1}def${2}ghi`, f.thisIsNotATag("abc"), f.thisIsNotATag("abc1def2ghi");
diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithIncompatibleTypedTags_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithIncompatibleTypedTags_es2015.2.minified.js
index 1763a2652f..7acb15b5d2 100644
--- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithIncompatibleTypedTags_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithIncompatibleTypedTags_es2015.2.minified.js
@@ -1,2 +1,2 @@
 var f;
-f`abc`, f`abc${1}def${2}ghi`, f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`[0].member`abc${1}def${2}ghi`, f`abc${1}def${2}ghi`.member.member`abc${1}def${2}ghi`, f`abc${true}def${true}ghi`.member.member`abc${1}def${2}ghi`, f.thisIsNotATag("abc"), f.thisIsNotATag("abc1def2ghi");
+f`abc`, f`abc${1}def${2}ghi`, f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`.member, f`abc${1}def${2}ghi`.member, f`abc`[0].member`abc${1}def${2}ghi`, f`abc${1}def${2}ghi`.member.member`abc${1}def${2}ghi`, f`abc${!0}def${!0}ghi`.member.member`abc${1}def${2}ghi`, f.thisIsNotATag("abc"), f.thisIsNotATag("abc1def2ghi");
diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_ES6_es2015.2.minified.js
index e813e92a0e..d7f8153d4f 100644
--- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_ES6_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_ES6_es2015.2.minified.js
@@ -1,2 +1,2 @@
 function foo(...stuff) {}
-foo([]), foo([], 1), foo([], 1, 2), foo([], 1, !0), foo([], 1, "2"), foo([], 1, 2, 3), foo``, foo`${1}`, foo`${1}${2}`, foo`${1}${true}`, foo`${1}${"2"}`, foo`${1}${2}${3}`;
+foo([]), foo([], 1), foo([], 1, 2), foo([], 1, !0), foo([], 1, "2"), foo([], 1, 2, 3), foo``, foo`${1}`, foo`${1}${2}`, foo`${1}${!0}`, foo`${1}${"2"}`, foo`${1}${2}${3}`;
diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_es2015.2.minified.js
index e813e92a0e..d7f8153d4f 100644
--- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution1_es2015.2.minified.js
@@ -1,2 +1,2 @@
 function foo(...stuff) {}
-foo([]), foo([], 1), foo([], 1, 2), foo([], 1, !0), foo([], 1, "2"), foo([], 1, 2, 3), foo``, foo`${1}`, foo`${1}${2}`, foo`${1}${true}`, foo`${1}${"2"}`, foo`${1}${2}${3}`;
+foo([]), foo([], 1), foo([], 1, 2), foo([], 1, !0), foo([], 1, "2"), foo([], 1, 2, 3), foo``, foo`${1}`, foo`${1}${2}`, foo`${1}${!0}`, foo`${1}${"2"}`, foo`${1}${2}${3}`;
diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es2015.2.minified.js
index c05a4ba4ea..02e5cb9637 100644
--- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_ES6_es2015.2.minified.js
@@ -2,13 +2,13 @@ function fn1() {
     return null;
 }
 function fn2() {}
-fn1`${undefined}`, fn1`${{}}`;
-var d1 = fn2`${0}${undefined}`, d2 = fn2`${0}${undefined}`;
+fn1`${void 0}`, fn1`${{}}`;
+var d1 = fn2`${0}${void 0}`, d2 = fn2`${0}${void 0}`;
 function fn3() {
     return null;
 }
 function fn4() {}
 function fn5() {}
-d1.foo(), d2(), fn2`${0}${''}`, fn2`${''}${0}`, fn3`${3}`, fn3`${''}${3}${''}`, fn3`${5}${5}${5}`, fn3`${4}`, fn3`${''}${''}${''}`, fn3`${''}${''}${3}`, fn3``, fn4`${''}${3}`, fn4`${3}${''}`, fn4`${3}${undefined}`, fn4`${''}${null}`, fn4`${null}${null}`, fn4`${true}${null}`, fn4`${null}${true}`, fn5`${(n)=>n.toFixed()
+d1.foo(), d2(), fn2`${0}${""}`, fn2`${""}${0}`, fn3`${3}`, fn3`${""}${3}${""}`, fn3`${5}${5}${5}`, fn3`${4}`, fn3`${""}${""}${""}`, fn3`${""}${""}${3}`, fn3``, fn4`${""}${3}`, fn4`${3}${""}`, fn4`${3}${void 0}`, fn4`${""}${null}`, fn4`${null}${null}`, fn4`${!0}${null}`, fn4`${null}${!0}`, fn5`${(n)=>n.toFixed()
 }`, fn5`${(n)=>n.substr(0)
 }`;
diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es2015.2.minified.js
index c05a4ba4ea..02e5cb9637 100644
--- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithOverloadResolution3_es2015.2.minified.js
@@ -2,13 +2,13 @@ function fn1() {
     return null;
 }
 function fn2() {}
-fn1`${undefined}`, fn1`${{}}`;
-var d1 = fn2`${0}${undefined}`, d2 = fn2`${0}${undefined}`;
+fn1`${void 0}`, fn1`${{}}`;
+var d1 = fn2`${0}${void 0}`, d2 = fn2`${0}${void 0}`;
 function fn3() {
     return null;
 }
 function fn4() {}
 function fn5() {}
-d1.foo(), d2(), fn2`${0}${''}`, fn2`${''}${0}`, fn3`${3}`, fn3`${''}${3}${''}`, fn3`${5}${5}${5}`, fn3`${4}`, fn3`${''}${''}${''}`, fn3`${''}${''}${3}`, fn3``, fn4`${''}${3}`, fn4`${3}${''}`, fn4`${3}${undefined}`, fn4`${''}${null}`, fn4`${null}${null}`, fn4`${true}${null}`, fn4`${null}${true}`, fn5`${(n)=>n.toFixed()
+d1.foo(), d2(), fn2`${0}${""}`, fn2`${""}${0}`, fn3`${3}`, fn3`${""}${3}${""}`, fn3`${5}${5}${5}`, fn3`${4}`, fn3`${""}${""}${""}`, fn3`${""}${""}${3}`, fn3``, fn4`${""}${3}`, fn4`${3}${""}`, fn4`${3}${void 0}`, fn4`${""}${null}`, fn4`${null}${null}`, fn4`${!0}${null}`, fn4`${null}${!0}`, fn5`${(n)=>n.toFixed()
 }`, fn5`${(n)=>n.substr(0)
 }`;
diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6_es2015.2.minified.js
index d9fb8adf28..418ec0a997 100644
--- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpressionES6_es2015.2.minified.js
@@ -1,3 +1,3 @@
 (function(...rest) {})`${function(x) {
-    x = "bad";
+    "bad";
 }}`;
diff --git a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression_es2015.2.minified.js b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression_es2015.2.minified.js
index d9fb8adf28..418ec0a997 100644
--- a/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression_es2015.2.minified.js
+++ b/crates/swc/tests/tsc-references/taggedTemplateStringsWithTypeErrorInFunctionExpressionsInSubstitutionExpression_es2015.2.minified.js
@@ -1,3 +1,3 @@
 (function(...rest) {})`${function(x) {
-    x = "bad";
+    "bad";
 }}`;
diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/2923/1/input.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/2923/1/input.js
new file mode 100644
index 0000000000..f149c2fc57
--- /dev/null
+++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/2923/1/input.js
@@ -0,0 +1,6 @@
+export default function example(html) {
+    const test = () => {
+        return 'test';
+    };
+    return html`${test()}`
+}
\ No newline at end of file
diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/issues/2923/1/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/issues/2923/1/output.js
new file mode 100644
index 0000000000..03b32a8963
--- /dev/null
+++ b/crates/swc_ecma_minifier/tests/compress/fixture/issues/2923/1/output.js
@@ -0,0 +1,3 @@
+export default function example(html) {
+    return html`${"test"}`;
+};
diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/alias-outside.6e8773c7/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/alias-outside.6e8773c7/output.js
index 38e8d1be72..3560605103 100644
--- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/alias-outside.6e8773c7/output.js
+++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/alias-outside.6e8773c7/output.js
@@ -1,6 +1,6 @@
 import { m } from "../index.f66dda46.js";
 const value$1 = "it works", value = "it works";
 function AliasOutside() {
-    return m`<div><p>Inside: ${value}</p><p>Outside: ${value$1}</p></div>`;
+    return m`<div><p>Inside: ${"it works"}</p><p>Outside: ${"it works"}</p></div>`;
 }
 export default AliasOutside;
diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/index.bf24abaa/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/index.bf24abaa/output.js
index 6509738b80..acc4fc1ddf 100644
--- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/index.bf24abaa/output.js
+++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/index.bf24abaa/output.js
@@ -10,7 +10,7 @@ const process = {
     }
 }, foo = 42;
 function Environment() {
-    return m`<table><thead><tr><th>Name ${foo}</th><th>Value</th></tr></thead><tbody>${Object.keys(process.env).sort().map((key)=>{
+    return m`<table><thead><tr><th>Name ${42}</th><th>Value</th></tr></thead><tbody>${Object.keys(process.env).sort().map((key)=>{
         return m`<tr key=${key}><td>${key}</td><td>${String(process.env[key])}</td></tr>`;
     })}</tbody></table>`;
 }
diff --git a/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/index.ddc4110d/output.js b/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/index.ddc4110d/output.js
index af0ded506c..9b30016166 100644
--- a/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/index.ddc4110d/output.js
+++ b/crates/swc_ecma_minifier/tests/compress/fixture/projects/wmr/archive-1/chunks/index.ddc4110d/output.js
@@ -6,6 +6,6 @@ function About({ query , title ,  }) {
     return y(()=>(console.log("Mounted About: ", title), ()=>{
             console.log("Unmounting About: ", title);
         })
-    , []), m`<section class=${styles.about}><h1>${title || "About"}</h1><p>My name is Jason.</p><pre>${JSON.stringify(query)}</pre></section>`;
+    , []), m`<section class=${"about_migxty"}><h1>${title || "About"}</h1><p>My name is Jason.</p><pre>${JSON.stringify(query)}</pre></section>`;
 }
 export default About;