From 77fa8bf01cf6eabf69896c5e62e641761742254d Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Wed, 11 Feb 2015 20:14:21 +1100 Subject: [PATCH] fix isReferenced on AssignmentPattern --- lib/6to5/types/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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} */