Skip to content

Commit

Permalink
Merge branch 'main' into fix/issue-8774
Browse files Browse the repository at this point in the history
  • Loading branch information
swc-bot authored Mar 26, 2024
2 parents 337f57a + cd06af3 commit b51de8b
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 12 deletions.
11 changes: 3 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
- **(es/minifier)** Abort eval on `valueOf` or `toString` ([#8763](https://github.com/swc-project/swc/issues/8763)) ([9f98a70](https://github.com/swc-project/swc/commit/9f98a7026df50a548011baf6d075d00bdd77a85a))


- **(es/minifier)** Fix tpl-to-string conversion ([#8778](https://github.com/swc-project/swc/issues/8778)) ([e7bca10](https://github.com/swc-project/swc/commit/e7bca101424ed3a3195ca6f45fd4993318cf105d))


- **(es/module)** Fix interop of `jsc.paths` with symlinks ([#8757](https://github.com/swc-project/swc/issues/8757)) ([e2c6db5](https://github.com/swc-project/swc/commit/e2c6db5226e9b34442ab65e02d5bbc3fa9aca65c))


Expand Down Expand Up @@ -1404,12 +1407,4 @@

- **(es/minifier)** Remove `mutated` and `mutation_by_call_count` ([#7890](https://github.com/swc-project/swc/issues/7890)) ([8db968a](https://github.com/swc-project/swc/commit/8db968a25d508a0d28d15d556ad121951f39ae0d))

## [1.3.80] - 2023-08-25

### Bug Fixes



- **(es/module)** Don't resolve as `node_modules` from `TscResolver` ([#7866](https://github.com/swc-project/swc/issues/7866)) ([11ebae1](https://github.com/swc-project/swc/commit/11ebae1bdd2fbd05d908fa560b81b830dddb3c56))

<!-- generated by git-cliff -->
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions crates/swc/tests/fixture/issues-8xxx/8773/input/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"jsc": {
"parser": {
"syntax": "ecmascript",
"jsx": false
},
"target": "es2022",
"loose": false,
"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": {
"toplevel": false,
"keep_classnames": false,
"keep_fnames": false,
"keep_private_props": false,
"ie8": false,
"safari10": false
}
}
},
"module": {
"type": "es6"
},
"minify": true,
"isModule": true
}
1 change: 1 addition & 0 deletions crates/swc/tests/fixture/issues-8xxx/8773/input/1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const t = "\\\\"; console.log(`${t}`)
1 change: 1 addition & 0 deletions crates/swc/tests/fixture/issues-8xxx/8773/output/1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log("\\\\");
2 changes: 1 addition & 1 deletion crates/swc_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
license = "Apache-2.0"
name = "swc_core"
repository = "https://github.com/swc-project/swc.git"
version = "0.90.25"
version = "0.90.26"
[package.metadata.docs.rs]
features = [
"allocator_node",
Expand Down
2 changes: 1 addition & 1 deletion crates/swc_ecma_minifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ include = ["Cargo.toml", "src/**/*.rs", "src/lists/*.json"]
license = "Apache-2.0"
name = "swc_ecma_minifier"
repository = "https://github.com/swc-project/swc.git"
version = "0.192.18"
version = "0.192.19"

[package.metadata.docs.rs]
all-features = true
Expand Down
1 change: 1 addition & 0 deletions crates/swc_ecma_minifier/src/compress/pure/strings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ impl Pure<'_> {
Expr::Tpl(t) if t.quasis.len() == 1 && t.exprs.is_empty() => {
if let Some(value) = &t.quasis[0].cooked {
if value.chars().all(|c| match c {
'\\' => false,
'\u{0020}'..='\u{007e}' => true,
'\n' | '\r' => self.config.force_str_for_tpl,
_ => false,
Expand Down

0 comments on commit b51de8b

Please sign in to comment.