Open
Description
π Search Terms
static class field, useDefineForClassFields
π Version & Regression Information
This bug exists at least with v3.7.5 and v5.8.3.
β― Playground Link
π» Code
class Foo {
static foo: undefined;
constructor() {
console.log('foo' in Foo)
}
}
new Foo()
π Actual behavior
console.log('foo' in Foo)
outputs false
after transformed.
π Expected behavior
console.log('foo' in Foo)
to output true
after transformed. Because removing : undefined
from the input and running that outputs true
.
Additional information about the issue
esbuild, babel, SWC transforms correctly (esbuild try, babel repl, SWC playground)
Private static fields works fine (TS playground).