clean up t.getIds
This commit is contained in:
@@ -490,7 +490,11 @@ t.toBlock = function (node, parent) {
|
||||
};
|
||||
|
||||
/**
|
||||
* Description
|
||||
* Return a list of identifiers that will be assigned
|
||||
* as a result of runtime evaluation.
|
||||
*
|
||||
* If an identifier is passed as `node` instead of a
|
||||
* declaration then it's assumed to be an assignable.
|
||||
*
|
||||
* @param {Object} node
|
||||
* @param {Boolean} [map]
|
||||
@@ -499,15 +503,15 @@ t.toBlock = function (node, parent) {
|
||||
*/
|
||||
|
||||
t.getIds = function (node, map, ignoreTypes) {
|
||||
ignoreTypes = ignoreTypes || [];
|
||||
|
||||
var search = [].concat(node);
|
||||
var ids = object();
|
||||
|
||||
while (search.length) {
|
||||
var id = search.shift();
|
||||
if (!id) continue;
|
||||
if (_.contains(ignoreTypes, id.type)) continue;
|
||||
|
||||
// blacklist types
|
||||
if (ignoreTypes && ignoreTypes.indexOf(id.type) >= 0) continue;
|
||||
|
||||
var nodeKeys = t.getIds.nodes[id.type];
|
||||
var arrKeys = t.getIds.arrays[id.type];
|
||||
|
||||
Reference in New Issue
Block a user