flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gregd...@apache.org
Subject git commit: [flex-falcon] [refs/heads/develop] - FLEX-35283. Switched parseInt with single argument to output undefined as explicit 2nd (radix or base) argument. See ticket for details
Date Wed, 22 Mar 2017 16:14:38 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop 13a58d87a -> 702006281


FLEX-35283. Switched parseInt with single argument to output undefined as explicit 2nd (radix
or base) argument.
See ticket for details


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/70200628
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/70200628
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/70200628

Branch: refs/heads/develop
Commit: 70200628124557d322d50243119282144f382c6a
Parents: 13a58d8
Author: greg-dove <greg.dove@gmail.com>
Authored: Wed Mar 22 05:32:40 2017 +1300
Committer: greg-dove <greg.dove@gmail.com>
Committed: Wed Mar 22 20:12:50 2017 +1300

----------------------------------------------------------------------
 .../internal/codegen/js/flexjs/JSFlexJSEmitter.java | 16 +++++-----------
 .../js/flexjs/TestFlexJSGlobalFunctions.java        |  2 +-
 2 files changed, 6 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/70200628/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
index abb9d3b..cd7a189 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/js/flexjs/JSFlexJSEmitter.java
@@ -38,7 +38,6 @@ import org.apache.flex.compiler.definitions.IPackageDefinition;
 import org.apache.flex.compiler.definitions.ITypeDefinition;
 import org.apache.flex.compiler.definitions.metadata.IMetaTagAttribute;
 import org.apache.flex.compiler.internal.codegen.as.ASEmitterTokens;
-import org.apache.flex.compiler.internal.codegen.js.JSEmitterTokens;
 import org.apache.flex.compiler.internal.codegen.js.JSSessionModel.ImplicitBindableImplementation;
 import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitter;
 import org.apache.flex.compiler.internal.codegen.js.goog.JSGoogEmitterTokens;
@@ -72,15 +71,7 @@ import org.apache.flex.compiler.internal.embedding.EmbedMIMEType;
 import org.apache.flex.compiler.internal.projects.CompilerProject;
 import org.apache.flex.compiler.internal.projects.FlexJSProject;
 import org.apache.flex.compiler.internal.projects.FlexProject;
-import org.apache.flex.compiler.internal.tree.as.BinaryOperatorAsNode;
-import org.apache.flex.compiler.internal.tree.as.BlockNode;
-import org.apache.flex.compiler.internal.tree.as.DynamicAccessNode;
-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.IdentifierNode;
-import org.apache.flex.compiler.internal.tree.as.LabeledStatementNode;
-import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
-import org.apache.flex.compiler.internal.tree.as.NumericLiteralNode;
+import org.apache.flex.compiler.internal.tree.as.*;
 import org.apache.flex.compiler.problems.EmbedUnableToReadSourceProblem;
 import org.apache.flex.compiler.projects.ICompilerProject;
 import org.apache.flex.compiler.tree.ASTNodeID;
@@ -789,7 +780,10 @@ public class JSFlexJSEmitter extends JSGoogEmitter implements IJSFlexJSEmitter
                 {
                     if (nameNode instanceof IdentifierNode)
                     {
-                        newNode = EmitterUtils.insertArgumentsAfter(node, new NumericLiteralNode("10"));
+                        //see FLEX-35283
+                        LiteralNode appendedArgument = new NumericLiteralNode("undefined");
+                        appendedArgument.setSynthetic(true);
+                        newNode = EmitterUtils.insertArgumentsAfter(node, appendedArgument);
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/70200628/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalFunctions.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalFunctions.java
b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalFunctions.java
index 9364d45..0ed2fc4 100644
--- a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalFunctions.java
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/js/flexjs/TestFlexJSGlobalFunctions.java
@@ -107,7 +107,7 @@ public class TestFlexJSGlobalFunctions extends TestGoogGlobalFunctions
     {
         IVariableNode node = getVariable("var a:int = parseInt('1.8');");
         asBlockWalker.visitVariable(node);
-        assertOut("var /** @type {number} */ a = parseInt('1.8', 10)");
+        assertOut("var /** @type {number} */ a = parseInt('1.8', undefined)");
     }
 
     @Test


Mime
View raw message