Repository: swc-project/swc (rust)

Issue:
Unexpected escape character in minification
### Describe the bug

```js
console.log(`\t`)
``` 
becomes following after minimize
```js
console.log(`\\t`)
```

### Input code

```typescript
console.log(`\t`)
```


### Config

```json
{
  "jsc": {
    "parser": {
      "syntax": "ecmascript",
      "jsx": true,
    },
    "target": "es5",
    "transform": {
      "react": {
        "development": true
      }
    },
    "minify": {
      "compress": {
        "arguments": false,
        "arrows": true,
        "booleans": true,
        "booleans_as_integers": false,
        "collapse_vars": true,
        "comparisons": true,
        "computed_props": true,
        "conditionals": true,
        "dead_code": true,
        "directives": true,
        "drop_console": false,
        "drop_debugger": true,
        "evaluate": true,
        "expression": false,
        "hoist_funs": false,
        "hoist_props": true,
        "hoist_vars": false,
        "if_return": true,
        "join_vars": true,
        "keep_classnames": false,
        "keep_fargs": true,
        "keep_fnames": false,
        "keep_infinity": false,
        "loops": true,
        "negate_iife": true,
        "properties": true,
        "reduce_funcs": false,
        "reduce_vars": false,
        "side_effects": true,
        "switches": true,
        "typeofs": true,
        "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": true,
        "const_to_let": true,
        "pristine_globals": true
      },
      "mangle": false,
      "inlineSourcesContent": false
    }
  },
  "minify": false,
}
```


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

https://play.swc.rs/?version=1.3.102&code=H4sIAAAAAAAAA0vOzyvOz0nVy8lP10iIKUnQBAD%2BOphpEQAAAA%3D%3D&config=H4sIAAAAAAAAA32US3IiMQyG9zkF1etsZzPbqcoF5gAuY8uNGdvqsmRCV4q7j%2FoBgaBmBa3P%2BvWwrK%2B33a47kut%2B777kr3wMthLU27dYaCxsz2LpwGVLrsaBu%2FcrPdKEuDZYTJflp2Nbe%2BDZi351V2O1hQLWfK9fwTq%2BM4jJwwkSDhkKr%2BIruzzEyLHEMN5rOcxDBaJHOUmlTVqTOdhE8H7PKn7SQwmzfY%2BYQLLdJsaSiYWhh6oJO0zJDgTmZKuiMmVqayTUQkywMXgzVBxUXnzkiEViPlMP1huHHhQUKziOJ9DcJJa4FZLylHpm7GHf%2Bn6ejx%2FecLKpWVZiwnm%2BEslWUT1gJDahFa2FC9zowQLX5v70jMFU4FbLs98RY9m4k38A0oFkiYrNoOnOJ4LM05Z3eOkZS5CR5VHhCdUqC%2FTSVBNjUDo7dQYqR%2B02K%2FjmYOqs09JZ8Ub7KHowEILMiiJNn5HdQQvK4wAYFCD3a4M2VQswt1e4wacH8QJ%2FSJWsD9h6Ils%2BbFMa8x7TiwAZ%2BID%2BxQG5CsZtXGVLnIdt3ooHGQ3w6pFGM3heAvIAGE0C1mZDnocomj7h%2FntNXPfobX9nW%2Frn997FksT5L7bqgP6grLl5Fc%2BHlh38tqp8b%2BFV4fIfpsL%2FzFUGAAA%3D

### SWC Info output

_No response_

### Expected behavior

should be the same string with input

### Actual behavior

`\t` becomes `\\t`

### Version

1.3.102

### Additional context

_No response_

Pull request description:
fix(es/minifier): Correctly escape more characters
**Description:**


**Related issue:**

 - Closes #8484

Patch:
diff --git a/crates/swc_ecma_minifier/src/compress/pure/strings.rs b/crates/swc_ecma_minifier/src/compress/pure/strings.rs
index 0bde969305..36ab38a58a 100644
--- a/crates/swc_ecma_minifier/src/compress/pure/strings.rs
+++ b/crates/swc_ecma_minifier/src/compress/pure/strings.rs
@@ -222,8 +222,12 @@ impl Pure<'_> {
                     let value = c
                         .replace("\\`", "`")
                         .replace("\\$", "$")
+                        .replace("\\b", "\u{0008}")
+                        .replace("\\f", "\u{000C}")
                         .replace("\\n", "\n")
                         .replace("\\r", "\r")
+                        .replace("\\t", "\t")
+                        .replace("\\v", "\u{000B}")
                         .replace("\\\\", "\\");
 
                     report_change!("converting a template literal to a string literal");


Test patch:
diff --git a/crates/swc/tests/fixture/issues-8xxx/8484/input/.swcrc b/crates/swc/tests/fixture/issues-8xxx/8484/input/.swcrc
new file mode 100644
index 0000000000..9e546b0fd3
--- /dev/null
+++ b/crates/swc/tests/fixture/issues-8xxx/8484/input/.swcrc
@@ -0,0 +1,65 @@
+{
+    "jsc": {
+        "parser": {
+            "syntax": "ecmascript",
+            "jsx": true,
+        },
+        "target": "es2022",
+        "transform": {
+            "react": {
+                "development": true
+            }
+        },
+        "minify": {
+            "compress": {
+                "arguments": false,
+                "arrows": true,
+                "booleans": true,
+                "booleans_as_integers": false,
+                "collapse_vars": true,
+                "comparisons": true,
+                "computed_props": true,
+                "conditionals": true,
+                "dead_code": true,
+                "directives": true,
+                "drop_console": false,
+                "drop_debugger": true,
+                "evaluate": true,
+                "expression": false,
+                "hoist_funs": false,
+                "hoist_props": true,
+                "hoist_vars": false,
+                "if_return": true,
+                "join_vars": true,
+                "keep_classnames": false,
+                "keep_fargs": true,
+                "keep_fnames": false,
+                "keep_infinity": false,
+                "loops": true,
+                "negate_iife": true,
+                "properties": true,
+                "reduce_funcs": false,
+                "reduce_vars": false,
+                "side_effects": true,
+                "switches": true,
+                "typeofs": true,
+                "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": true,
+                "const_to_let": true,
+                "pristine_globals": true
+            },
+            "mangle": false,
+            "inlineSourcesContent": false
+        }
+    },
+    "minify": false,
+}
\ No newline at end of file
diff --git a/crates/swc/tests/fixture/issues-8xxx/8484/input/1.js b/crates/swc/tests/fixture/issues-8xxx/8484/input/1.js
new file mode 100644
index 0000000000..7d4aaa1c4a
--- /dev/null
+++ b/crates/swc/tests/fixture/issues-8xxx/8484/input/1.js
@@ -0,0 +1,1 @@
+console.log(`\t`)
diff --git a/crates/swc/tests/fixture/issues-8xxx/8484/output/1.js b/crates/swc/tests/fixture/issues-8xxx/8484/output/1.js
new file mode 100644
index 0000000000..f42124346f
--- /dev/null
+++ b/crates/swc/tests/fixture/issues-8xxx/8484/output/1.js
@@ -0,0 +1,1 @@
+console.log("	");