From 80d362c534b8e72141d48fcee1b9718b8933272d Mon Sep 17 00:00:00 2001 From: Andres Suarez Date: Tue, 16 Jun 2015 23:37:32 -0400 Subject: [PATCH] fix matchesPattern with deep member expressions --- src/babel/traversal/path/introspection.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/babel/traversal/path/introspection.js b/src/babel/traversal/path/introspection.js index 9588018900..4495520e06 100644 --- a/src/babel/traversal/path/introspection.js +++ b/src/babel/traversal/path/introspection.js @@ -40,8 +40,8 @@ export function matchesPattern(pattern: string, allowPartial?: boolean): boolean // we can't deal with this return false; } else { - search.push(node.object); - search.push(node.property); + search.unshift(node.property); + search.unshift(node.object); continue; } } else if (t.isThisExpression(node)) { @@ -57,7 +57,7 @@ export function matchesPattern(pattern: string, allowPartial?: boolean): boolean } } - return true; + return i === parts.length; } /**