-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
Spec: Private MethodsoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
Bug Report
- I would like to work on a fix!
Current behavior
When accessing or checking for a private static field, the generated code references the class constructor, which could be shadowed.
Input Code
class Test {
static #x = 1
method() {
const Test = 1;
#x in v; // Test is shadowed in generated code
v.#x; // Test is shadowed in generated code
}
}Expected behavior
Either a warning, or generated code avoids the issue.
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
presets: 'stage-2'
Environment
babel playground
Possible Solution
Perhaps the generated code could capture a separate reference in a temp variable before it's shadowed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Spec: Private MethodsoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue