|| p.tail_node() === self) {
self = p;
} else if (p instanceof AST_Return) {
- var fn;
- do {
- fn = this.parent(++i);
- if (!fn) return false;
- } while (!(fn instanceof AST_Lambda));
- if (fn.name) return false;
- self = this.parent(++i);
- if (!self || self.TYPE != "Call" || self.expression !== fn) return false;
+ for (var call, fn = p; call = this.parent(++i); fn = call) {
+ if (call.TYPE == "Call") {
+ if (!(fn instanceof AST_Lambda) || fn.name) return false;
+ } else if (fn instanceof AST_Lambda) {
+ return false;
+ }
+ }
} else {
return false;
}