From a7de73fbe94d1c33ca71bf2bd8becdaea27fe73b Mon Sep 17 00:00:00 2001 From: Rich-Harris Date: Sat, 2 Jan 2016 10:26:22 -0500 Subject: [PATCH] add comment re arrow function expression special case --- src/ast/isReference.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ast/isReference.js b/src/ast/isReference.js index 4b8c71b..98d8df5 100644 --- a/src/ast/isReference.js +++ b/src/ast/isReference.js @@ -4,6 +4,9 @@ export default function isReference ( node, parent ) { } if ( node.type === 'Identifier' ) { + // the only time we could have an identifier node without a parent is + // if it's the entire body of a function without a block statement – + // i.e. an arrow function expression like `a => a` if ( !parent ) return true; // TODO is this right?