Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0FC30F547 for ; Fri, 12 Apr 2013 07:02:28 +0000 (UTC) Received: (qmail 30076 invoked by uid 500); 12 Apr 2013 07:02:27 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 29972 invoked by uid 500); 12 Apr 2013 07:02:27 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 29946 invoked by uid 99); 12 Apr 2013 07:02:27 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Apr 2013 07:02:27 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 343D081938A; Fri, 12 Apr 2013 07:02:27 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aharui@apache.org To: commits@flex.apache.org Date: Fri, 12 Apr 2013 07:02:28 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/8] git commit: Fix bug in for/foreach handling Fix bug in for/foreach handling Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/4eb9af88 Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/4eb9af88 Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/4eb9af88 Branch: refs/heads/develop Commit: 4eb9af881ee9681291a6550768267516785f35ff Parents: 645e6e6 Author: Alex Harui Authored: Sun Apr 7 21:13:17 2013 -0700 Committer: Alex Harui Committed: Thu Apr 11 17:24:47 2013 -0700 ---------------------------------------------------------------------- .../internal/as/codegen/JSGeneratingReducer.java | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/4eb9af88/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGeneratingReducer.java ---------------------------------------------------------------------- diff --git a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGeneratingReducer.java b/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGeneratingReducer.java index f1ffd63..8d6eb76 100644 --- a/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGeneratingReducer.java +++ b/compiler.js/src/org/apache/flex/compiler/internal/as/codegen/JSGeneratingReducer.java @@ -98,6 +98,7 @@ import org.apache.flex.compiler.internal.semantics.SemanticUtils; import org.apache.flex.compiler.internal.tree.as.BaseDefinitionNode; import org.apache.flex.compiler.internal.tree.as.BaseVariableNode; import org.apache.flex.compiler.internal.tree.as.ExpressionNodeBase; +import org.apache.flex.compiler.internal.tree.as.ForLoopNode; import org.apache.flex.compiler.internal.tree.as.FunctionCallNode; import org.apache.flex.compiler.internal.tree.as.FunctionNode; import org.apache.flex.compiler.internal.tree.as.FunctionObjectNode; @@ -123,6 +124,7 @@ import org.apache.flex.compiler.problems.UnknownNamespaceProblem; import org.apache.flex.compiler.problems.VoidTypeProblem; import org.apache.flex.compiler.projects.ICompilerProject; import org.apache.flex.compiler.scopes.IASScope; +import org.apache.flex.compiler.tree.ASTNodeID; import org.apache.flex.compiler.tree.as.IASNode; import org.apache.flex.compiler.tree.as.IDynamicAccessNode; import org.apache.flex.compiler.tree.as.IBinaryOperatorNode; @@ -3243,8 +3245,9 @@ public class JSGeneratingReducer public String reduce_forKeyValueStmt(IASNode iNode, Binding it, String base, String body, int opcode) { + boolean isForInLoop = iNode.getNodeID() == ASTNodeID.ForLoopID; String result = generateForKeyOrValueLoop(iNode, opcode, it, base, body); - result += reduce_forLoop(iNode, it, base, body, false); + result += reduce_forLoop(iNode, it, base, body, isForInLoop); return result; }