diff --git a/lib/6to5/types/index.js b/lib/6to5/types/index.js index 65fb12bedc..d4b95ee677 100644 --- a/lib/6to5/types/index.js +++ b/lib/6to5/types/index.js @@ -128,8 +128,8 @@ t.isDynamic = function (node) { }; t.isReferenced = function (node, parent) { - // we're a property key so we aren't referenced - if (t.isProperty(parent) && parent.key === node) return false; + // we're a property key and we aren't computed so we aren't referenced + if (t.isProperty(parent) && parent.key === node && !parent.computed) return false; // we're a variable declarator id so we aren't referenced if (t.isVariableDeclarator(parent) && parent.id === node) return false; @@ -256,8 +256,8 @@ t.getIds = function (node, map, ignoreTypes) { t.getIds.nodes = { AssignmentExpression: "left", - ImportSpecifier: "id", - ExportSpecifier: "id", + ImportSpecifier: "name", + ExportSpecifier: "name", VariableDeclarator: "id", FunctionDeclaration: "id", ClassDeclaration: "id",