From 6f926cee9d6b259845cd91069cb7c6f488d1eed6 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 19 Oct 2009 22:20:11 +0000 Subject: [PATCH] Replaced function closure 'for each'..in compilation with a with closure. --- Output.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Output.cpp b/Output.cpp index 7580288..a5d9743 100644 --- a/Output.cpp +++ b/Output.cpp @@ -360,14 +360,8 @@ void CYFor::Output(std::ostream &out) const { } void CYForEachIn::Output(std::ostream &out) const { - const char *name(initialiser_->ForEachIn()); + out << "with({$cys:0,$cyt:0}){"; - if (name != NULL) { - out << '{'; - out << "var " << name << ';'; - } - - out << "(function($cys,$cyt){"; out << "$cys="; set_->Output(out, CYPA, CYNoFlags); out << ";"; @@ -379,10 +373,9 @@ void CYForEachIn::Output(std::ostream &out) const { code_->Show(out); - out << "}}());"; + out << '}'; - if (name != NULL) - out << '}'; + out << '}'; } void CYForEachInComprehension::Begin_(std::ostream &out) const { -- 2.45.2