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 4F56A17724 for ; Tue, 22 Sep 2015 17:34:41 +0000 (UTC) Received: (qmail 75653 invoked by uid 500); 22 Sep 2015 17:34:39 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 75547 invoked by uid 500); 22 Sep 2015 17:34:39 -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 75420 invoked by uid 99); 22 Sep 2015 17:34:39 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Sep 2015 17:34:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 88FD9E0663; Tue, 22 Sep 2015 17:34:39 +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: Tue, 22 Sep 2015 17:34:52 -0000 Message-Id: <96c497c7f05f4798bd5e22b00564db18@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [14/24] git commit: [flex-falcon] [refs/heads/JsToAs] - handle conditional compilation in method bodies handle conditional compilation in method bodies Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/b8a026ee Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/b8a026ee Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/b8a026ee Branch: refs/heads/JsToAs Commit: b8a026ee005b57b8a29cc2e2e3a4dcb7f9093cfc Parents: 9085281 Author: Alex Harui Authored: Thu Sep 17 12:14:16 2015 -0700 Committer: Alex Harui Committed: Tue Sep 22 10:35:15 2015 -0700 ---------------------------------------------------------------------- .../org/apache/flex/compiler/internal/codegen/as/ASEmitter.java | 1 + .../apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/b8a026ee/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java ---------------------------------------------------------------------- diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java index fa743c2..5150917 100644 --- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java +++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitter.java @@ -820,6 +820,7 @@ public class ASEmitter implements IASEmitter, IEmitter getWalker().walk(node); // XXX (mschmalle) this should be in the after handler? if (node.getParent().getNodeID() != ASTNodeID.LabledStatementID + && node.getNodeID() != ASTNodeID.ConfigBlockID && !(node instanceof IStatementNode)) { write(ASEmitterTokens.SEMICOLON); http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/b8a026ee/compiler.jx/src/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java ---------------------------------------------------------------------- diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java b/compiler.jx/src/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java index cd75f31..d925b6d 100644 --- a/compiler.jx/src/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java +++ b/compiler.jx/src/org/apache/flex/compiler/internal/visitor/as/ASNodeSwitch.java @@ -21,6 +21,7 @@ package org.apache.flex.compiler.internal.visitor.as; import org.apache.flex.compiler.internal.tree.as.BinaryOperatorAsNode; import org.apache.flex.compiler.internal.tree.as.BinaryOperatorIsNode; +import org.apache.flex.compiler.internal.tree.as.ConfigConditionBlockNode; import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode; import org.apache.flex.compiler.internal.tree.as.NamespaceAccessExpressionNode; import org.apache.flex.compiler.tree.ASTNodeID; @@ -115,7 +116,9 @@ public class ASNodeSwitch implements IASNodeStrategy return; case ConfigBlockID: - // ToDo (erikdebruin): implement handler + ConfigConditionBlockNode condcomp = (ConfigConditionBlockNode)node; + if (condcomp.getChildCount() > 0) // will be 0 if conditional compile variable is false + visitor.visitBlock((IBlockNode) node); return; case E4XFilterID: