From a3c383429eeeef05885598e4a1731da8d4404130 Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Sat, 18 Jul 2015 14:37:18 -0400 Subject: [PATCH] dont rewrite class method keys incorrectly (#42) --- src/Statement.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Statement.js b/src/Statement.js index a570912..7cfbebf 100644 --- a/src/Statement.js +++ b/src/Statement.js @@ -341,6 +341,7 @@ export default class Statement { if ( node.type !== 'Identifier' ) return; if ( parent.type === 'MemberExpression' && !parent.computed && node !== parent.object ) return; if ( parent.type === 'Property' && node !== parent.value ) return; + if ( parent.type === 'MethodDefinition' && node === parent.key ) return; // TODO others...? const name = names[ node.name ];