babel-plugin-minify-mangle-names
Advanced tools
Comparing version 0.5.0-alpha.5f601890 to 0.5.0-alpha.6889f45d
@@ -146,2 +146,23 @@ "use strict"; | ||
/** | ||
* This is required because after function name transformation | ||
* plugin (part of es2015), the function name is NOT added to the | ||
* scope's bindings. So to fix this issue, we simply add a hack to | ||
* handle that case - fix it to the scope tree. | ||
* | ||
* Related: | ||
* - https://github.com/babel/minify/issues/829 | ||
*/ | ||
BindingIdentifier(path) { | ||
if ( // the parent has this id as the name | ||
(path.parentPath.isFunctionExpression({ | ||
id: path.node | ||
}) || path.parentPath.isClassExpression({ | ||
id: path.node | ||
})) && // and the id isn't yet added to the scope | ||
!hop.call(path.parentPath.scope.bindings, path.node.name)) { | ||
path.parentPath.scope.registerBinding("local", path.parentPath); | ||
} | ||
}, | ||
/** | ||
* This is necessary because, in Babel, the scope.references | ||
@@ -148,0 +169,0 @@ * does NOT contain the references in that scope. Only the program |
{ | ||
"name": "babel-plugin-minify-mangle-names", | ||
"version": "0.5.0-alpha.5f601890", | ||
"version": "0.5.0-alpha.6889f45d", | ||
"description": "", | ||
@@ -15,4 +15,4 @@ "keywords": [ | ||
"dependencies": { | ||
"babel-helper-mark-eval-scopes": "^0.5.0-alpha.5f601890" | ||
"babel-helper-mark-eval-scopes": "^0.5.0-alpha.6889f45d" | ||
} | ||
} |
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
33263
884