From 33ae022e4dd6b366e75ca65fe6277298a41b6f51 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Thu, 9 Jul 2015 18:19:20 +0100 Subject: [PATCH] add ClassProperty handling to t.isReferenced - fixes #1961 --- src/babel/types/validators.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/babel/types/validators.js b/src/babel/types/validators.js index 884f5223b6..9db9a5d3b7 100644 --- a/src/babel/types/validators.js +++ b/src/babel/types/validators.js @@ -77,6 +77,11 @@ export function isReferenced(node: Object, parent: Object): boolean { case "JSXAttribute": return parent.name !== node; + // no: class { NODE = value; } + // yes: class { key = NODE; } + case "ClassProperty": + return parent.value === node; + // no: import NODE from "foo"; // no: import * as NODE from "foo"; // no: import { NODE as foo } from "foo";