This commit is contained in:
@@ -94,15 +94,15 @@ t.toBlock = function (node, parent) {
|
||||
return t.blockStatement(node);
|
||||
};
|
||||
|
||||
t.getIds = function (node) {
|
||||
t.getIds = function (node, map) {
|
||||
var search = [node];
|
||||
var ids = [];
|
||||
var ids = {};
|
||||
|
||||
while (search.length) {
|
||||
var id = search.shift();
|
||||
|
||||
if (t.isIdentifier(id)) {
|
||||
ids.push(id.name);
|
||||
ids[id.name] = id;
|
||||
} else if (t.isArrayPattern(id)) {
|
||||
_.each(id.elements, function (elem) {
|
||||
search.push(elem);
|
||||
@@ -122,6 +122,7 @@ t.getIds = function (node) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!map) ids = _.keys(ids);
|
||||
return ids;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user