diff --git a/lib/6to5/util.js b/lib/6to5/util.js index af2b740605..04e4e97ce3 100644 --- a/lib/6to5/util.js +++ b/lib/6to5/util.js @@ -7,7 +7,7 @@ var fs = require("fs"); var t = require("./types"); var _ = require("lodash"); -_.extend(estraverse.VisitorKeys, traverse.VISITOR_KEYS); +_.extend(estraverse.VisitorKeys, t.VISITOR_KEYS); exports.inherits = util.inherits; @@ -46,31 +46,6 @@ exports.isAbsolute = function (loc) { return false; }; -exports.getIds = function (node) { - var search = [node]; - var ids = []; - - while (search.length) { - var id = search.shift(); - - if (t.isIdentifier(id)) { - ids.push(id.name); - } else if (t.isArrayPattern(id)) { - _.each(id.elements, function (elem) { - search.push(elem); - }); - } else if (t.isObjectPattern(id)) { - _.each(id.properties, function (prop) { - search.push(prop.value); - }); - } else { - throw new Error("unknown node " + id.type); - } - } - - return ids; -}; - exports.canCompile = function (filename) { var ext = path.extname(filename); return _.contains([".js", ".es6"], ext);