check for existence of variable when checking if node is pure
This commit is contained in:
parent
30e3908484
commit
01d399ee3c
@ -553,7 +553,7 @@ export default class Scope {
|
||||
isPure(node) {
|
||||
if (t.isIdentifier(node)) {
|
||||
var bindingInfo = this.getBinding(node.name);
|
||||
return bindingInfo.constant;
|
||||
return bindingInfo && bindingInfo.constant;
|
||||
} else {
|
||||
return t.isPure(node);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user