don't evaluate non-referenced identifiers

This commit is contained in:
Sebastian McKenzie 2015-05-30 19:07:58 -04:00
parent f979d55b71
commit 29e24a4cbe
2 changed files with 1 additions and 5 deletions

View File

@ -11,7 +11,3 @@ export var Expression = {
if (res.confident) return t.valueToNode(res.value);
}
};
export function Identifier() {
// override Expression
}

View File

@ -78,7 +78,7 @@ export function evaluate(): { confident: boolean; value: any } {
return undefined;
}
if (path.isIdentifier() || path.isMemberExpression()) {
if ((path.isIdentifier() || path.isMemberExpression()) && path.isReferenced()) {
path = path.resolve();
if (path) {
return evaluate(path);