Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: privateFieldsAsProperties global counter (#15389)
When babel-helpers are inlined, classPrivateFieldLooseKey() defines a global variable `id` and initialized it to zero in every generated file. This can lead to name clashes between #-private members in subclass and superclass, which again leads to incorrect semantics. In the new solution, instead of trying to produce a globally unique private property name string, a Symbol is created. The helper function classPrivateFieldLooseKey() is no longer used, but kept for backwards-compatibility. In environments where Symbol is not available (Internet Explorer), a polyfill must be included. For details and discussion of other solutions, see #15389 For easier review, the test output updates follow in a separate commit.
- Loading branch information