babel-plugin-minify-dead-code-elimination
Advanced tools
Comparing version 0.3.0-alpha.9a74dfd1 to 0.3.0-alpha.a351eeed
@@ -275,2 +275,8 @@ "use strict"; | ||
return "continue"; | ||
} else if ( | ||
// ClassDeclaration has binding in two scopes | ||
// 1. The scope in which it is declared | ||
// 2. The class's own scope | ||
binding.path.isClassDeclaration() && binding.path === scope.path) { | ||
return "continue"; | ||
} | ||
@@ -427,3 +433,8 @@ | ||
if (replacementPath.isIdentifier()) { | ||
_bail = refPath.scope.getBinding(replacement.name) !== scope.getBinding(replacement.name); | ||
var _binding2 = scope.getBinding(replacement.name); | ||
// the reference should be in the same scope | ||
// and the replacement should be a constant - this is to | ||
// ensure that the duplication of replacement is not affected | ||
// https://github.com/babel/minify/issues/685 | ||
_bail = !(_binding2 && refPath.scope.getBinding(replacement.name) === _binding2 && _binding2.constantViolations.length === 0); | ||
} else { | ||
@@ -441,3 +452,6 @@ replacementPath.traverse({ | ||
} | ||
_bail = refPath.scope.getBinding(node.name) !== scope.getBinding(node.name); | ||
var binding = scope.getBinding(node.name); | ||
if (binding && refPath.scope.getBinding(node.name) === binding) { | ||
_bail = binding.constantViolations.length > 0; | ||
} | ||
} | ||
@@ -444,0 +458,0 @@ }); |
{ | ||
"name": "babel-plugin-minify-dead-code-elimination", | ||
"version": "0.3.0-alpha.9a74dfd1", | ||
"version": "0.3.0-alpha.a351eeed", | ||
"description": "", | ||
@@ -15,7 +15,7 @@ "keywords": [ | ||
"dependencies": { | ||
"babel-helper-evaluate-path": "^0.3.0-alpha.9a74dfd1", | ||
"babel-helper-mark-eval-scopes": "^0.3.0-alpha.9a74dfd1", | ||
"babel-helper-remove-or-void": "^0.3.0-alpha.9a74dfd1", | ||
"babel-helper-evaluate-path": "^0.3.0-alpha.a351eeed", | ||
"babel-helper-mark-eval-scopes": "^0.3.0-alpha.a351eeed", | ||
"babel-helper-remove-or-void": "^0.3.0-alpha.a351eeed", | ||
"lodash.some": "^4.6.0" | ||
} | ||
} |
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
48229
1235