Revert "don't push array pattern uid if it's a local variable"

This reverts commit 86acc99fb3.
This commit is contained in:
Sebastian McKenzie
2015-02-16 01:06:14 +11:00
parent 86acc99fb3
commit f2300a5463

View File

@@ -146,11 +146,9 @@ DestructuringTransformer.prototype.pushArrayPattern = function (pattern, parentI
var toArray = this.scope.toArray(parentId, count);
if (!t.isIdentifier(parentId) || !this.scope.hasBinding(parentId.name)) {
var _parentId = this.scope.generateUidBasedOnNode(parentId);
this.nodes.push(this.buildVariableDeclaration(_parentId, toArray));
parentId = _parentId;
}
var _parentId = this.scope.generateUidBasedOnNode(parentId);
this.nodes.push(this.buildVariableDeclaration(_parentId, toArray));
parentId = _parentId;
this.scope.assignTypeGeneric(parentId.name, "Array");