diff --git a/lib/6to5/types/index.js b/lib/6to5/types/index.js index 4e960efffb..51752c3961 100644 --- a/lib/6to5/types/index.js +++ b/lib/6to5/types/index.js @@ -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];