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 73847C4FE for ; Fri, 1 Nov 2013 11:33:25 +0000 (UTC) Received: (qmail 13504 invoked by uid 500); 1 Nov 2013 11:33:20 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 13349 invoked by uid 500); 1 Nov 2013 11:33:18 -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 13112 invoked by uid 99); 1 Nov 2013 11:33:15 -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, 01 Nov 2013 11:33:15 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id E93C2D5A1; Fri, 1 Nov 2013 11:33:14 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: erikdebruin@apache.org To: commits@flex.apache.org Date: Fri, 01 Nov 2013 11:33:22 -0000 Message-Id: <81b2677546c04da4baf0863fce64ac97@git.apache.org> In-Reply-To: <6a5f39747edc4abe88d01535bfb3ab6a@git.apache.org> References: <6a5f39747edc4abe88d01535bfb3ab6a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [09/10] git commit: [flex-falcon] [refs/heads/develop] - Small fix to JS emitter and the addition of 'org.apache.flex.utils.Language' emission to the MXML emitter. Small fix to JS emitter and the addition of 'org.apache.flex.utils.Language' emission to the MXML emitter. Signed-off-by: Erik de Bruin Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/1d2d36cc Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/1d2d36cc Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/1d2d36cc Branch: refs/heads/develop Commit: 1d2d36cc9223672143e0f0a39e9823d94a03c221 Parents: 8b36845 Author: Erik de Bruin Authored: Fri Nov 1 10:33:38 2013 +0100 Committer: Erik de Bruin Committed: Fri Nov 1 12:32:58 2013 +0100 ---------------------------------------------------------------------- .../codegen/js/flexjs/JSFlexJSEmitter.java | 24 ++++++++------------ .../codegen/mxml/flexjs/MXMLFlexJSEmitter.java | 22 ++++++++++++++++-- 2 files changed, 30 insertions(+), 16 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/1d2d36cc/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java ---------------------------------------------------------------------- diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java index 4110e79..60460fc 100644 --- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java +++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java @@ -34,7 +34,6 @@ import org.apache.flex.compiler.common.ModifiersSet; import org.apache.flex.compiler.definitions.IDefinition; import org.apache.flex.compiler.definitions.IFunctionDefinition; import org.apache.flex.compiler.definitions.IFunctionDefinition.FunctionClassification; -import org.apache.flex.compiler.definitions.IInterfaceDefinition; import org.apache.flex.compiler.definitions.INamespaceDefinition; import org.apache.flex.compiler.definitions.IPackageDefinition; import org.apache.flex.compiler.definitions.ITypeDefinition; @@ -873,20 +872,17 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter // 'as' operators. We don't need to worry about requiring // this in every project: ADVANCED_OPTIMISATIONS will NOT // include any of the code if it is not used in the project. - if (flexProject.mainCU != null) + if (flexProject.mainCU != null && + cu.getName().equals(flexProject.mainCU.getName())) { - if (!(type instanceof IInterfaceDefinition) && - cu.getName().equals(flexProject.mainCU.getName())) - { - write(JSGoogEmitterTokens.GOOG_REQUIRE); - write(ASEmitterTokens.PAREN_OPEN); - write(ASEmitterTokens.SINGLE_QUOTE); - write(JSFlexJSEmitterTokens.LANGUAGE_QNAME); - write(ASEmitterTokens.SINGLE_QUOTE); - write(ASEmitterTokens.PAREN_CLOSE); - writeNewline(ASEmitterTokens.SEMICOLON); - writeNewline(); - } + write(JSGoogEmitterTokens.GOOG_REQUIRE); + write(ASEmitterTokens.PAREN_OPEN); + write(ASEmitterTokens.SINGLE_QUOTE); + write(JSFlexJSEmitterTokens.LANGUAGE_QNAME); + write(ASEmitterTokens.SINGLE_QUOTE); + write(ASEmitterTokens.PAREN_CLOSE); + writeNewline(ASEmitterTokens.SEMICOLON); + writeNewline(); } } http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/1d2d36cc/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java ---------------------------------------------------------------------- diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java index 29b78ca..7669e81 100644 --- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java +++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/mxml/flexjs/MXMLFlexJSEmitter.java @@ -23,8 +23,8 @@ package org.apache.flex.compiler.internal.codegen.mxml.flexjs; import java.io.FilterWriter; import java.util.ArrayList; import java.util.List; -import java.util.Set; import java.util.Map.Entry; +import java.util.Set; import org.apache.flex.abc.semantics.MethodInfo; import org.apache.flex.abc.semantics.Name; @@ -39,9 +39,10 @@ import org.apache.flex.compiler.internal.codegen.databinding.BindingInfo; import org.apache.flex.compiler.internal.codegen.databinding.FunctionWatcherInfo; import org.apache.flex.compiler.internal.codegen.databinding.PropertyWatcherInfo; import org.apache.flex.compiler.internal.codegen.databinding.WatcherInfoBase; -import org.apache.flex.compiler.internal.codegen.databinding.XMLWatcherInfo; import org.apache.flex.compiler.internal.codegen.databinding.WatcherInfoBase.WatcherType; +import org.apache.flex.compiler.internal.codegen.databinding.XMLWatcherInfo; import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitter; +import org.apache.flex.compiler.internal.codegen.js.flexjs.JSFlexJSEmitterTokens; import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens; import org.apache.flex.compiler.internal.codegen.mxml.MXMLEmitter; import org.apache.flex.compiler.internal.projects.FlexJSProject; @@ -1354,6 +1355,23 @@ public class MXMLFlexJSEmitter extends MXMLEmitter implements } } } + + // erikdebruin: Add missing language feature support, like the 'is' and + // 'as' operators. We don't need to worry about requiring + // this in every project: ADVANCED_OPTIMISATIONS will NOT + // include any of the code if it is not used in the project. + if (project.mainCU != null && + cu.getName().equals(project.mainCU.getName())) + { + write(JSGoogEmitterTokens.GOOG_REQUIRE); + write(ASEmitterTokens.PAREN_OPEN); + write(ASEmitterTokens.SINGLE_QUOTE); + write(JSFlexJSEmitterTokens.LANGUAGE_QNAME); + write(ASEmitterTokens.SINGLE_QUOTE); + write(ASEmitterTokens.PAREN_CLOSE); + writeNewline(ASEmitterTokens.SEMICOLON); + writeNewline(); + } } private void emitHeaderLine(String qname)