Skip to content

Commit

Permalink
super property shim: change to work outside class
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Apr 5, 2022
1 parent e24dfc7 commit 7f87558
Show file tree
Hide file tree
Showing 6 changed files with 476 additions and 545 deletions.
20 changes: 20 additions & 0 deletions internal/bundler/bundler_lower_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -973,6 +973,16 @@ func TestLowerAsyncSuperES2017NoBundle(t *testing.T) {
async a() { return class { [super.foo] = 123 } }
b = async () => class { [super.foo] = 123 }
}
// This covers putting the generated temporary variable inside the loop
for (let i = 0; i < 3; i++) {
objs.push({
__proto__: {
foo() { return i },
},
async bar() { return super.foo() },
})
}
`,
},
entryPaths: []string{"/entry.js"},
Expand Down Expand Up @@ -1036,6 +1046,16 @@ func TestLowerAsyncSuperES2016NoBundle(t *testing.T) {
async a() { return class { [super.foo] = 123 } }
b = async () => class { [super.foo] = 123 }
}
// This covers putting the generated temporary variable inside the loop
for (let i = 0; i < 3; i++) {
objs.push({
__proto__: {
foo() { return i },
},
async bar() { return super.foo() },
})
}
`,
},
entryPaths: []string{"/entry.js"},
Expand Down
Loading

0 comments on commit 7f87558

Please sign in to comment.