remap UpdateExpression in module exports - closes #334
This commit is contained in:
@@ -240,14 +240,17 @@ t.getIds = function (node, map, ignoreTypes) {
|
||||
if (_.contains(ignoreTypes, id.type)) continue;
|
||||
|
||||
var nodeKey = t.getIds.nodes[id.type];
|
||||
var arrKey = t.getIds.arrays[id.type];
|
||||
var arrKeys = t.getIds.arrays[id.type];
|
||||
|
||||
if (t.isIdentifier(id)) {
|
||||
ids[id.name] = id;
|
||||
} else if (nodeKey) {
|
||||
if (id[nodeKey]) search.push(id[nodeKey]);
|
||||
} else if (arrKey) {
|
||||
search = search.concat(id[arrKey] || []);
|
||||
} else if (arrKeys) {
|
||||
for (var i in arrKeys) {
|
||||
var key = arrKeys[i];
|
||||
search = search.concat(id[key] || []);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,11 +271,11 @@ t.getIds.nodes = {
|
||||
};
|
||||
|
||||
t.getIds.arrays = {
|
||||
ExportDeclaration: "specifiers",
|
||||
ImportDeclaration: "specifiers",
|
||||
VariableDeclaration: "declarations",
|
||||
ArrayPattern: "elements",
|
||||
ObjectPattern: "properties"
|
||||
ExportDeclaration: ["specifiers", "declaration"],
|
||||
ImportDeclaration: ["specifiers"],
|
||||
VariableDeclaration: ["declarations"],
|
||||
ArrayPattern: ["elements"],
|
||||
ObjectPattern: ["properties"]
|
||||
};
|
||||
|
||||
t.isLet = function (node) {
|
||||
|
||||
Reference in New Issue
Block a user