Skip to content

Commit 7f87558

Browse files
committed
super property shim: change to work outside class
1 parent e24dfc7 commit 7f87558

File tree

6 files changed

+476
-545
lines changed

6 files changed

+476
-545
lines changed

internal/bundler/bundler_lower_test.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,16 @@ func TestLowerAsyncSuperES2017NoBundle(t *testing.T) {
973973
async a() { return class { [super.foo] = 123 } }
974974
b = async () => class { [super.foo] = 123 }
975975
}
976+
977+
// This covers putting the generated temporary variable inside the loop
978+
for (let i = 0; i < 3; i++) {
979+
objs.push({
980+
__proto__: {
981+
foo() { return i },
982+
},
983+
async bar() { return super.foo() },
984+
})
985+
}
976986
`,
977987
},
978988
entryPaths: []string{"/entry.js"},
@@ -1036,6 +1046,16 @@ func TestLowerAsyncSuperES2016NoBundle(t *testing.T) {
10361046
async a() { return class { [super.foo] = 123 } }
10371047
b = async () => class { [super.foo] = 123 }
10381048
}
1049+
1050+
// This covers putting the generated temporary variable inside the loop
1051+
for (let i = 0; i < 3; i++) {
1052+
objs.push({
1053+
__proto__: {
1054+
foo() { return i },
1055+
},
1056+
async bar() { return super.foo() },
1057+
})
1058+
}
10391059
`,
10401060
},
10411061
entryPaths: []string{"/entry.js"},

0 commit comments

Comments
 (0)