]> git.saurik.com Git - cycript.git/blobdiff - Replace.cpp
Preserve declaration initialisers replacing for-each.
[cycript.git] / Replace.cpp
index d508db0e252b2dd15aea7a9f6c13ce781968cdfd..5be4e01b718f413f6f9bae136a6cdcb3e6e4ed35 100644 (file)
@@ -357,6 +357,12 @@ CYStatement *CYForInComprehension::Replace(CYContext &context, CYStatement *stat
 }
 
 CYStatement *CYForEachIn::Replace(CYContext &context) {
+    if (CYAssignment *assignment = initialiser_->Assignment(context))
+        return $ CYBlock($$->*
+            $E(assignment)->*
+            this
+        );
+
     CYIdentifier *cys($I("$cys")), *cyt($I("$cyt"));
 
     return $ CYLet($L2($L(cys, set_), $L(cyt)), $$->*