I'm aware that the TypeScript compiler can use a workaround via WeakMap
to "polyfill" ECMAScript Private class fields, but when does/doesn't it do that?
According to the official documentation, the TypeScript compiler uses WeakMap
s when the target output is configured to ES2021 or less, and otherwise outputs ECMAScript private class fields.