diff --git a/src/babel/traversal/path/hoister.js b/src/babel/traversal/path/hoister.js index 6bb4283364..137fa6c233 100644 --- a/src/babel/traversal/path/hoister.js +++ b/src/babel/traversal/path/hoister.js @@ -16,11 +16,13 @@ var referenceVisitor = { // eg. it's in a closure etc if (bindingInfo !== state.scope.getBinding(node.name)) return; - if (bindingInfo && bindingInfo.constant) { - state.bindings[node.name] = bindingInfo; - } else { - state.foundIncompatible = true; - this.stop(); + if (bindingInfo) { + if (bindingInfo.constant) { + state.bindings[node.name] = bindingInfo; + } else { + state.foundIncompatible = true; + this.stop(); + } } } }