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 C73801863B for ; Tue, 1 Sep 2015 20:19:29 +0000 (UTC) Received: (qmail 68107 invoked by uid 500); 1 Sep 2015 20:19:29 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 68069 invoked by uid 500); 1 Sep 2015 20:19:29 -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 68018 invoked by uid 99); 1 Sep 2015 20:19:29 -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, 01 Sep 2015 20:19:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 88D59DFE5F; Tue, 1 Sep 2015 20:19:29 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: fthomas@apache.org To: commits@flex.apache.org Date: Tue, 01 Sep 2015 20:19:29 -0000 Message-Id: <7c661f195e1e423ebf75c6dd56ef89cb@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [1/6] git commit: [flex-falcon] [refs/heads/JsToAs] - Now emit _as() / _is() instead of as() / is(). Repository: flex-falcon Updated Branches: refs/heads/JsToAs [created] bb6425450 Now emit _as() / _is() instead of as() / is(). This is to match the changes made in the AS/JS project: In order to migrate the JS code to AS3 code, we can't use "as" / "is" as function name because there are reserved words. Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/5caf88d6 Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/5caf88d6 Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/5caf88d6 Branch: refs/heads/JsToAs Commit: 5caf88d668335d2c1a23bd33c4f41664a8792526 Parents: 8884d0b Author: Frédéric THOMAS Authored: Tue Sep 1 21:03:13 2015 +0100 Committer: Frédéric THOMAS Committed: Tue Sep 1 21:03:13 2015 +0100 ---------------------------------------------------------------------- .../codegen/js/flexjs/TestFlexJSExpressions.java | 12 ++++++------ .../internal/codegen/js/vf2js/TestVF2JSExpressions.java | 6 +++--- .../compiler/internal/codegen/as/ASEmitterTokens.java | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5caf88d6/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java ---------------------------------------------------------------------- diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java index daee543..8729784 100644 --- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java +++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSExpressions.java @@ -542,7 +542,7 @@ public class TestFlexJSExpressions extends TestGoogExpressions ((JSFlexJSEmitter)asEmitter).getModel().setCurrentClass(def); asBlockWalker.visitBinaryOperator(bnode); - assertOut("org.apache.flex.utils.Language.as(this.model, foo.bar.E, true).labelText = null"); + assertOut("org.apache.flex.utils.Language._as(this.model, foo.bar.E, true).labelText = null"); } @Test @@ -706,7 +706,7 @@ public class TestFlexJSExpressions extends TestGoogExpressions { IClassNode node = (IClassNode) getNode("import spark.components.Button; public class B implements Button { public function B() { Button(b).label = ''; } }", ClassNode.class, WRAP_LEVEL_PACKAGE); asBlockWalker.visitClass(node); - assertOut("/**\n * @constructor\n * @implements {spark.components.Button}\n */\nB = function() {\n org.apache.flex.utils.Language.as(b, spark.components.Button, true).label = '';\n};"); + assertOut("/**\n * @constructor\n * @implements {spark.components.Button}\n */\nB = function() {\n org.apache.flex.utils.Language._as(b, spark.components.Button, true).label = '';\n};"); } @Test @@ -714,7 +714,7 @@ public class TestFlexJSExpressions extends TestGoogExpressions { IFunctionNode node = getMethod("function foo(){var foo:Object = FalconTest_A(bar).bar = '';}; public function get bar():Object { return this; };"); asBlockWalker.visitFunction(node); - assertOut("FalconTest_A.prototype.foo = function() {\n var /** @type {Object} */ foo = org.apache.flex.utils.Language.as(this.bar, FalconTest_A, true).bar = '';\n}"); + assertOut("FalconTest_A.prototype.foo = function() {\n var /** @type {Object} */ foo = org.apache.flex.utils.Language._as(this.bar, FalconTest_A, true).bar = '';\n}"); } @Test @@ -761,7 +761,7 @@ public class TestFlexJSExpressions extends TestGoogExpressions { IBinaryOperatorNode node = getBinaryNode("a as b"); asBlockWalker.visitBinaryOperator(node); - assertOut("org.apache.flex.utils.Language.as(a, b)"); + assertOut("org.apache.flex.utils.Language._as(a, b)"); } @Test @@ -771,7 +771,7 @@ public class TestFlexJSExpressions extends TestGoogExpressions "public class B {public function b(o:Object):int { var a:B; a = o as B; }}", IFunctionNode.class, WRAP_LEVEL_PACKAGE, true); asBlockWalker.visitFunction(node); - assertOut("/**\n * @export\n * @param {Object} o\n * @return {number}\n */\nfoo.bar.B.prototype.b = function(o) {\n var /** @type {foo.bar.B} */ a;\n a = org.apache.flex.utils.Language.as(o, foo.bar.B);\n}"); + assertOut("/**\n * @export\n * @param {Object} o\n * @return {number}\n */\nfoo.bar.B.prototype.b = function(o) {\n var /** @type {foo.bar.B} */ a;\n a = org.apache.flex.utils.Language._as(o, foo.bar.B);\n}"); } @Override @@ -780,7 +780,7 @@ public class TestFlexJSExpressions extends TestGoogExpressions { IBinaryOperatorNode node = getBinaryNode("a is b"); asBlockWalker.visitBinaryOperator(node); - assertOut("org.apache.flex.utils.Language.is(a, b)"); + assertOut("org.apache.flex.utils.Language._is(a, b)"); } protected IBackend createBackend() http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5caf88d6/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSExpressions.java ---------------------------------------------------------------------- diff --git a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSExpressions.java b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSExpressions.java index 3ba79e7..a05694c 100644 --- a/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSExpressions.java +++ b/compiler.jx.tests/src/org/apache/flex/compiler/internal/codegen/js/vf2js/TestVF2JSExpressions.java @@ -94,7 +94,7 @@ public class TestVF2JSExpressions extends TestGoogExpressions { IBinaryOperatorNode node = getBinaryNode("a as b"); asBlockWalker.visitBinaryOperator(node); - assertOut("org.apache.flex.utils.Language.as(a, b)"); + assertOut("org.apache.flex.utils.Language._as(a, b)"); } @Test @@ -104,7 +104,7 @@ public class TestVF2JSExpressions extends TestGoogExpressions "public class B {public function b(o:Object):int { var a:B; a = o as B; }}", IFunctionNode.class, WRAP_LEVEL_PACKAGE, true); asBlockWalker.visitFunction(node); - assertOut("/**\n * @export\n * @param {Object} o\n * @return {number}\n */\nfoo.bar.B.prototype.b = function(o) {\n var /** @type {foo.bar.B} */ a;\n a = org.apache.flex.utils.Language.as(o, foo.bar.B);\n}"); + assertOut("/**\n * @export\n * @param {Object} o\n * @return {number}\n */\nfoo.bar.B.prototype.b = function(o) {\n var /** @type {foo.bar.B} */ a;\n a = org.apache.flex.utils.Language._as(o, foo.bar.B);\n}"); } @Override @@ -113,7 +113,7 @@ public class TestVF2JSExpressions extends TestGoogExpressions { IBinaryOperatorNode node = getBinaryNode("a is b"); asBlockWalker.visitBinaryOperator(node); - assertOut("org.apache.flex.utils.Language.is(a, b)"); + assertOut("org.apache.flex.utils.Language._is(a, b)"); } protected IBackend createBackend() http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/5caf88d6/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitterTokens.java ---------------------------------------------------------------------- diff --git a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitterTokens.java b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitterTokens.java index 9296a78..e671aca 100644 --- a/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitterTokens.java +++ b/compiler.jx/src/org/apache/flex/compiler/internal/codegen/as/ASEmitterTokens.java @@ -133,8 +133,8 @@ public enum ASEmitterTokens implements IEmitterTokens LESS_THAN("<"), // int TOKEN_OPERATOR_LESS_THAN_EQUALS = 99; INSTANCEOF("instanceof"), - IS("is"), - AS("as"), + IS("_is"), + AS("_as"), // int TOKEN_OPERATOR_BITWISE_LEFT_SHIFT = 103; // int TOKEN_OPERATOR_BITWISE_RIGHT_SHIFT = 104; // int TOKEN_OPERATOR_BITWISE_UNSIGNED_RIGHT_SHIFT = 105;