From 34eb2babdbaeee4c63e7193e781ff77864861c9f Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Thu, 21 May 2015 18:58:07 +0100 Subject: [PATCH] don't consider JSXAttribute keys to be referenced identifiers - fixes #1596 --- src/babel/types/validators.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/babel/types/validators.js b/src/babel/types/validators.js index 8795582c7b..6212639a80 100644 --- a/src/babel/types/validators.js +++ b/src/babel/types/validators.js @@ -66,6 +66,10 @@ export function isReferenced(node: Object, parent: Object): boolean { case "ImportNamespaceSpecifier": return false; + // no:
+ case "JSXAttribute": + return parent.name !== node; + // no: import { NODE as foo } from "foo"; // no: import { foo as NODE } from "foo"; case "ImportSpecifier":