check for existence of variable when checking if node is pure

This commit is contained in:
Sebastian McKenzie 2015-05-15 18:48:17 +01:00
parent 30e3908484
commit 01d399ee3c

View File

@ -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);
}