diff --git a/lib/6to5/types/index.js b/lib/6to5/types/index.js index a2b4445c00..012bb267e6 100644 --- a/lib/6to5/types/index.js +++ b/lib/6to5/types/index.js @@ -423,6 +423,10 @@ t.buildMatchMemberExpression = function (match, allowPartial) { while (search.length) { var node = search.shift(); + if (allowPartial && i === parts.length) { + return true; + } + if (t.isIdentifier(node)) { // this part doesn't match if (parts[i] !== node.name) return false; @@ -444,8 +448,8 @@ t.buildMatchMemberExpression = function (match, allowPartial) { } // too many parts - if (++i >= parts.length) { - return !!allowPartial; + if (++i > parts.length) { + return false; } }