only register an Identifier node as static if it's a constant

This commit is contained in:
Sebastian McKenzie 2015-07-21 01:14:38 +01:00
parent b97dc4778b
commit 495b880372

View File

@ -376,8 +376,13 @@ export default class Scope {
return true;
}
if (t.isIdentifier(node) && this.hasBinding(node.name)) {
return true;
if (t.isIdentifier(node)) {
var binding = this.getBinding(node.name);
if (binding) {
return binding.constant;
} else {
return this.hasBinding(node.name);
}
}
return false;