Skip to content

Commit 88b0554

Browse files
committed
Fix: Compiler: Fix renaming for object partterns and assignment targets (#1588)
1 parent f4d64b6 commit 88b0554

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 5.8.2 (2024-05-24) - Luc
2+
3+
## Bug fixes
4+
* Compiler: fix variable renaming for property binding and assignment target (part 2)
5+
16
# 5.8.1 (2024-05-05) - Lille
27

38
## Features/Changes

compiler/lib/js_traverse.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,7 @@ class rename_variable ~esm =
13511351
when StringMap.mem name' subst ->
13521352
let x = Prop_binding (PNI name, (BindingIdent ident, e)) in
13531353
super#binding_property x
1354-
| x -> x
1354+
| x -> super#binding_property x
13551355

13561356
method expression e =
13571357
match e with

compiler/tests-compiler/minify.ml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,4 +471,16 @@ function h(x) {
471471
1: function
472472
2: h(a){var
473473
3: b;for({toto:b}in
474-
4: a)console.log(b)} |}])
474+
4: a)console.log(b)} |}];
475+
minify
476+
{|
477+
function h(f) {
478+
var { toto : c} = f();
479+
console.log({ toto : c });
480+
}
481+
|};
482+
[%expect
483+
{|
484+
$ cat "test.min.js"
485+
1: function
486+
2: h(a){var{toto:b}=a();console.log({toto:b})} |}])

0 commit comments

Comments
 (0)