@babel/helper-create-class-features-plugin
Advanced tools
Comparing version 7.9.5 to 7.9.6
@@ -112,13 +112,25 @@ "use strict"; | ||
const body = path.get("body.body"); | ||
const visiblePrivateNames = new Map(privateNamesMap); | ||
const redeclared = []; | ||
for (const prop of body) { | ||
if (!prop.isPrivate()) { | ||
continue; | ||
} | ||
if (!prop.isPrivate()) continue; | ||
const { | ||
name | ||
} = prop.node.key.id; | ||
visiblePrivateNames.delete(name); | ||
redeclared.push(name); | ||
} | ||
if (!privateNamesMap.has(prop.node.key.id.name)) continue; | ||
path.traverse(privateNameInnerVisitor, this); | ||
path.skip(); | ||
break; | ||
if (!redeclared.length) { | ||
return; | ||
} | ||
path.get("body").traverse(privateNameNestedVisitor, Object.assign({}, this, { | ||
redeclared | ||
})); | ||
path.traverse(privateNameVisitor, Object.assign({}, this, { | ||
privateNamesMap: visiblePrivateNames | ||
})); | ||
path.skipKey("body"); | ||
} | ||
@@ -128,3 +140,14 @@ | ||
const privateNameInnerVisitor = _core.traverse.visitors.merge([{ | ||
const privateNameNestedVisitor = _core.traverse.visitors.merge([{ | ||
PrivateName(path) { | ||
const { | ||
redeclared | ||
} = this; | ||
const { | ||
name | ||
} = path.node.id; | ||
if (redeclared.includes(name)) path.skip(); | ||
} | ||
}, { | ||
PrivateName: privateNameVisitor.PrivateName | ||
@@ -273,2 +296,3 @@ }, _helperReplaceSupers.environmentVisitor]); | ||
function transformPrivateNamesUsage(ref, path, privateNamesMap, loose, state) { | ||
if (!privateNamesMap.size) return; | ||
const body = path.get("body"); | ||
@@ -275,0 +299,0 @@ |
{ | ||
"name": "@babel/helper-create-class-features-plugin", | ||
"version": "7.9.5", | ||
"version": "7.9.6", | ||
"author": "The Babel Team (https://babeljs.io/team)", | ||
@@ -21,3 +21,3 @@ "license": "MIT", | ||
"@babel/helper-plugin-utils": "^7.8.3", | ||
"@babel/helper-replace-supers": "^7.8.6", | ||
"@babel/helper-replace-supers": "^7.9.6", | ||
"@babel/helper-split-export-declaration": "^7.8.3" | ||
@@ -29,6 +29,6 @@ }, | ||
"devDependencies": { | ||
"@babel/core": "^7.8.6", | ||
"@babel/core": "^7.9.6", | ||
"@babel/helper-plugin-test-runner": "^7.8.3" | ||
}, | ||
"gitHead": "5b97e77e030cf3853a147fdff81844ea4026219d" | ||
"gitHead": "9c2846bcacc75aa931ea9d556950c2113765d43d" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
40110
1018