diff --git a/lib/6to5/types/index.js b/lib/6to5/types/index.js index 6e21d7c50f..1b40721c2c 100644 --- a/lib/6to5/types/index.js +++ b/lib/6to5/types/index.js @@ -318,7 +318,7 @@ t.isReferenced = function (node, parent) { // no: [NODE = foo] = []; // yes: [foo = NODE] = []; if (t.isAssignmentPattern(parent)) { - return parent.right !== node; + return parent.right === node; } // no: [NODE] = []; @@ -348,8 +348,8 @@ t.isReferenced = function (node, parent) { /** * Check if the input `node` is an `Identifier` and `isReferenced`. * - * @param {Object} node - * @param {Object} parent + * @param {Node} node + * @parma {Node} parent * @returns {Boolean} */