don't evaluate non-referenced identifiers
This commit is contained in:
parent
f979d55b71
commit
29e24a4cbe
@ -11,7 +11,3 @@ export var Expression = {
|
||||
if (res.confident) return t.valueToNode(res.value);
|
||||
}
|
||||
};
|
||||
|
||||
export function Identifier() {
|
||||
// override Expression
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user