babel-plugin-minify-mangle-names
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -142,2 +142,26 @@ "use strict"; | ||
// Safari raises a syntax error for a `let` or `const` declaration in a | ||
// `for` loop initialization that shadows a parent function's parameter. | ||
// https://github.com/babel/babili/issues/559 | ||
// https://bugs.webkit.org/show_bug.cgi?id=171041 | ||
// https://trac.webkit.org/changeset/217200/webkit/trunk/Source | ||
var maybeDecl = binding.path.parentPath; | ||
var isBlockScoped = maybeDecl.isVariableDeclaration({ kind: "let" }) || maybeDecl.isVariableDeclaration({ kind: "const" }); | ||
if (isBlockScoped) { | ||
var maybeFor = maybeDecl.parentPath; | ||
var isForLoopBinding = maybeFor.isForStatement({ init: maybeDecl.node }) || maybeFor.isForXStatement({ left: maybeDecl.node }); | ||
if (isForLoopBinding) { | ||
var fnParent = maybeFor.getFunctionParent(); | ||
if (fnParent.isFunction({ body: maybeFor.parent })) { | ||
var parentFunctionBinding = this.bindings.get(fnParent.scope).get(next); | ||
if (parentFunctionBinding) { | ||
var parentFunctionHasParamBinding = parentFunctionBinding.kind === "param"; | ||
if (parentFunctionHasParamBinding) { | ||
return false; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
for (var i = 0; i < binding.constantViolations.length; i++) { | ||
@@ -144,0 +168,0 @@ var violation = binding.constantViolations[i]; |
{ | ||
"name": "babel-plugin-minify-mangle-names", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "", | ||
@@ -16,4 +16,3 @@ "homepage": "https://github.com/babel/babili#readme", | ||
"babel-helper-mark-eval-scopes": "^0.1.1" | ||
}, | ||
"devDependencies": {} | ||
} | ||
} |
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
40564
997