Skip to content

Commit 006f428

Browse files
committed
Add a test for swc-project#6047
1 parent 5d7f4b8 commit 006f428

File tree

1 file changed

+22
-1
lines changed
  • crates/swc_ecma_minifier/tests

1 file changed

+22
-1
lines changed

crates/swc_ecma_minifier/tests/exec.rs

+22-1
Original file line numberDiff line numberDiff line change
@@ -10132,7 +10132,7 @@ fn feedback_regex_range() {
1013210132
}
1013310133

1013410134
#[test]
10135-
fn issue_6047() {
10135+
fn issue_6047_1() {
1013610136
run_default_exec_test(
1013710137
r###"
1013810138
let foo = () => 1;
@@ -10151,3 +10151,24 @@ fn issue_6047() {
1015110151
"###,
1015210152
);
1015310153
}
10154+
10155+
#[test]
10156+
fn issue_6047_2() {
10157+
run_default_exec_test(
10158+
r###"
10159+
let foo = () => 1;
10160+
10161+
const obj = new Proxy({}, {
10162+
get () {
10163+
foo = () => 2;
10164+
return 40;
10165+
},
10166+
});
10167+
console.log(obj)
10168+
10169+
var c = obj[0];
10170+
10171+
console.log(foo(c));
10172+
"###,
10173+
);
10174+
}

0 commit comments

Comments
 (0)