diff --git a/bundler/Cargo.toml b/bundler/Cargo.toml index 8d04e1ce0c58..d28b00c4a101 100644 --- a/bundler/Cargo.toml +++ b/bundler/Cargo.toml @@ -9,7 +9,7 @@ include = ["Cargo.toml", "build.rs", "src/**/*.rs", "src/**/*.js"] license = "Apache-2.0/MIT" name = "swc_bundler" repository = "https://github.com/swc-project/swc.git" -version = "0.37.0" +version = "0.37.1" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] diff --git a/ecmascript/transforms/base/Cargo.toml b/ecmascript/transforms/base/Cargo.toml index 3dba6e81de2d..4f39df26281c 100644 --- a/ecmascript/transforms/base/Cargo.toml +++ b/ecmascript/transforms/base/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" license = "Apache-2.0/MIT" name = "swc_ecma_transforms_base" repository = "https://github.com/swc-project/swc.git" -version = "0.15.1" +version = "0.15.2" [dependencies] fxhash = "0.2.1" diff --git a/ecmascript/transforms/base/src/fixer.rs b/ecmascript/transforms/base/src/fixer.rs index 8b773fa55d3d..f46c6527008b 100644 --- a/ecmascript/transforms/base/src/fixer.rs +++ b/ecmascript/transforms/base/src/fixer.rs @@ -170,7 +170,9 @@ impl VisitMut for Fixer<'_> { self.wrap(&mut expr.right); } } - } else if op_of_rhs.precedence() <= expr.op.precedence() { + } else if op_of_rhs.precedence() <= expr.op.precedence() + || (*op_of_rhs == op!("&&") && expr.op == op!("??")) + { self.wrap(&mut expr.right); } } @@ -1184,4 +1186,8 @@ var store = global[SHARED] || (global[SHARED] = {}); deno_10487_2, "class MultiVector extends (options.baseType||Float32Array) {}" ); + + identical!(deno_10668_1, "console.log(null ?? (undefined && true))"); + + identical!(deno_10668_2, "console.log(null && (undefined ?? true))"); }