Fix bug with evaluating an expression in it's own binding

This commit is contained in:
Amjad Masad
2015-12-06 07:56:17 -08:00
parent abb85b498a
commit 036e90e9cc
2 changed files with 21 additions and 1 deletions

View File

@@ -360,7 +360,9 @@ export function _resolve(dangerous?, resolved?): ?NodePath {
if (binding.kind === "module") return;
if (binding.path !== this) {
return binding.path.resolve(dangerous, resolved);
let ret = binding.path.resolve(dangerous, resolved);
if (this.find(parent => parent.node === ret.node)) return;
return ret;
}
} else if (this.isTypeCastExpression()) {
return this.get("expression").resolve(dangerous, resolved);