@babel/plugin-transform-destructuring
Advanced tools
Comparing version 7.0.0 to 7.1.1
@@ -65,10 +65,13 @@ "use strict"; | ||
const arrayUnpackVisitor = { | ||
ReferencedIdentifier(path, state) { | ||
if (state.bindings[path.node.name]) { | ||
state.deopt = true; | ||
path.stop(); | ||
} | ||
const STOP_TRAVERSAL = {}; | ||
const arrayUnpackVisitor = (node, ancestors, state) => { | ||
if (!ancestors.length) { | ||
return; | ||
} | ||
if (_core().types.isIdentifier(node) && _core().types.isReferenced(node, ancestors[ancestors.length - 1]) && state.bindings[node.name]) { | ||
state.deopt = true; | ||
throw STOP_TRAVERSAL; | ||
} | ||
}; | ||
@@ -248,3 +251,9 @@ | ||
}; | ||
this.scope.traverse(arr, arrayUnpackVisitor, state); | ||
try { | ||
_core().types.traverse(arr, arrayUnpackVisitor, state); | ||
} catch (e) { | ||
if (e !== STOP_TRAVERSAL) throw e; | ||
} | ||
return !state.deopt; | ||
@@ -251,0 +260,0 @@ } |
{ | ||
"name": "@babel/plugin-transform-destructuring", | ||
"version": "7.0.0", | ||
"version": "7.1.1", | ||
"description": "Compile ES2015 destructuring to ES5", | ||
"repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-destructuring", | ||
"license": "MIT", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"main": "lib/index.js", | ||
@@ -8,0 +11,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
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
17666
409