fix Program global reference catching for real this time

This commit is contained in:
Sebastian McKenzie 2015-05-01 09:41:35 +01:00
parent 452d0ef30e
commit f155bc249c

View File

@ -42,8 +42,11 @@ var programReferenceVisitor = {
enter(node, parent, scope, state) {
if (t.isReferencedIdentifier(node, parent)) {
var bindingInfo = scope.getBinding(node.name);
if (bindingInfo) bindingInfo.reference();
state.addGlobal(node);
if (bindingInfo) {
bindingInfo.reference();
} else {
state.addGlobal(node);
}
} else if (t.isLabeledStatement(node)) {
state.addGlobal(node);
} else if (t.isAssignmentExpression(node)) {