Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement privateFieldsAsSymbols assumption for classes #15435

Merged
merged 6 commits into from Feb 20, 2023

Commits on Feb 17, 2023

  1. feature: new assumption privateFieldsAsSymbols, fixes babel#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 babel#15389, it has been discussed to fix this, but
    eventually the suggestion was to introduce a new assumption
    `privateFieldsAsSymbols` and deprecate (and later remove)
    the buggy `privateFieldsAsProperties`.
    In the new solution, instead of trying to produce a
    globally unique private property name string, a `Symbol`
    is created. To use the new assumption, in environments
    where `Symbol` is not available (Internet Explorer), a
    polyfill must be included.
    fwienber committed Feb 17, 2023
    Copy the full SHA
    5488b69 View commit details
    Browse the repository at this point in the history
  2. revert new usage of type AssumptionName

    Maybe the cross-package import made the tests
    in the PR CI job red?
    fwienber committed Feb 17, 2023
    Copy the full SHA
    4640fd6 View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2023

  1. Copy the full SHA
    fdf29dd View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    9f29214 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    fa02dea View commit details
    Browse the repository at this point in the history

Commits on Feb 20, 2023

  1. Copy the full SHA
    88b9a57 View commit details
    Browse the repository at this point in the history