You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2016/08/24 05:02:32 UTC
[1/7] git commit: [flex-falcon] [refs/heads/develop] - resolve
function calls to instance functions even if masked by local variable but
only for legacy codegen
Repository: flex-falcon
Updated Branches:
refs/heads/develop 2f6f611b1 -> ced58cc23
resolve function calls to instance functions even if masked by local variable but only for legacy codegen
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/2782237d
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/2782237d
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/2782237d
Branch: refs/heads/develop
Commit: 2782237d58119c21323e031219bc7649584247ff
Parents: 1642c4e
Author: Alex Harui <ah...@apache.org>
Authored: Tue Aug 23 07:38:18 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Aug 23 22:01:59 2016 -0700
----------------------------------------------------------------------
.../flex/compiler/config/Configuration.java | 5 ++--
.../internal/tree/as/IdentifierNode.java | 31 ++++++++++++++++++++
compiler/src/test/java/as/ASVariableTests.java | 26 ++++++++++++++++
3 files changed, 60 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2782237d/compiler/src/main/java/org/apache/flex/compiler/config/Configuration.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/config/Configuration.java b/compiler/src/main/java/org/apache/flex/compiler/config/Configuration.java
index e5e3613..79e555d 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/config/Configuration.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/config/Configuration.java
@@ -4616,16 +4616,17 @@ public class Configuration
// 'compiler.mxml.compatibility-version' option
//
+ public static final int MXML_VERSION_4_7 = 0x04070000;
public static final int MXML_VERSION_4_6 = 0x04060000;
public static final int MXML_VERSION_4_5 = 0x04050000;
public static final int MXML_VERSION_4_0 = 0x04000000;
public static final int MXML_VERSION_3_0 = 0x03000000;
public static final int MXML_VERSION_2_0_1 = 0x02000001;
public static final int MXML_VERSION_2_0 = 0x02000000;
- public static final int MXML_CURRENT_VERSION = MXML_VERSION_4_6;
+ public static final int MXML_CURRENT_VERSION = MXML_VERSION_4_7;
public static final int MXML_EARLIEST_MAJOR_VERSION = 3;
public static final int MXML_LATEST_MAJOR_VERSION = 4;
- public static final int MXML_LATEST_MINOR_VERSION = 6;
+ public static final int MXML_LATEST_MINOR_VERSION = 7;
private int mxml_major = MXML_LATEST_MAJOR_VERSION;
private int mxml_minor = MXML_LATEST_MINOR_VERSION;
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2782237d/compiler/src/main/java/org/apache/flex/compiler/internal/tree/as/IdentifierNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/internal/tree/as/IdentifierNode.java b/compiler/src/main/java/org/apache/flex/compiler/internal/tree/as/IdentifierNode.java
index 65d8478..da50f5d 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/internal/tree/as/IdentifierNode.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/internal/tree/as/IdentifierNode.java
@@ -37,19 +37,25 @@ import com.google.common.collect.ImmutableSet;
import org.apache.flex.abc.semantics.Name;
import org.apache.flex.abc.semantics.Nsset;
import org.apache.flex.compiler.common.DependencyType;
+import org.apache.flex.compiler.config.Configuration;
import org.apache.flex.compiler.constants.IASLanguageConstants;
import org.apache.flex.compiler.definitions.IClassDefinition;
import org.apache.flex.compiler.definitions.IDefinition;
import org.apache.flex.compiler.definitions.INamespaceDefinition;
import org.apache.flex.compiler.definitions.ITypeDefinition;
import org.apache.flex.compiler.definitions.IQualifiers;
+import org.apache.flex.compiler.definitions.IVariableDefinition.VariableClassification;
import org.apache.flex.compiler.definitions.references.INamespaceReference;
import org.apache.flex.compiler.definitions.references.IReference;
import org.apache.flex.compiler.definitions.references.ReferenceFactory;
import org.apache.flex.compiler.internal.definitions.AmbiguousDefinition;
+import org.apache.flex.compiler.internal.definitions.ClassDefinition;
+import org.apache.flex.compiler.internal.definitions.ClassDefinitionBase;
import org.apache.flex.compiler.internal.definitions.DefinitionBase;
+import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
import org.apache.flex.compiler.internal.definitions.NamespaceDefinition;
+import org.apache.flex.compiler.internal.definitions.VariableDefinition;
import org.apache.flex.compiler.internal.projects.FlexProject;
import org.apache.flex.compiler.internal.scopes.ASScope;
import org.apache.flex.compiler.internal.semantics.PostProcessStep;
@@ -384,7 +390,21 @@ public class IdentifierNode extends ExpressionNodeBase implements IIdentifierNod
else
{
if (qualifier == null)
+ {
result = asScope.findProperty(project, name, getDependencyType(), isTypeRef());
+ // ASVariableTests_localVarSameNameAsPrivateMethod
+ if (isLegacyCodegen(project) && result != null && getParent().getNodeID() == ASTNodeID.FunctionCallID && result instanceof VariableDefinition)
+ {
+ VariableDefinition varDef = (VariableDefinition)result;
+ if (varDef.getVariableClassification() == VariableClassification.LOCAL)
+ {
+ ClassDefinitionBase cdef = asScope.getContainingClass();
+ IDefinition memberResult = asScope.getPropertyFromDef(project, cdef, name, false);
+ if (memberResult instanceof FunctionDefinition)
+ result = memberResult;
+ }
+ }
+ }
else {
result = asScope.findPropertyQualified(project, qualifier, name, getDependencyType(), isTypeRef());
if (result == null && wasMemberRef && baseIsPackage())
@@ -1014,6 +1034,17 @@ public class IdentifierNode extends ExpressionNodeBase implements IIdentifierNod
return false;
}
+ public boolean isLegacyCodegen(ICompilerProject project)
+ {
+ final Integer compatibilityVersion = ((FlexProject)project).getCompatibilityVersion();
+ if (compatibilityVersion == null)
+ return false;
+ else if (compatibilityVersion <= Configuration.MXML_VERSION_4_6)
+ return true;
+ else
+ return false;
+ }
+
//
// Inner types
//
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2782237d/compiler/src/test/java/as/ASVariableTests.java
----------------------------------------------------------------------
diff --git a/compiler/src/test/java/as/ASVariableTests.java b/compiler/src/test/java/as/ASVariableTests.java
index f4684fd..b877fcc 100644
--- a/compiler/src/test/java/as/ASVariableTests.java
+++ b/compiler/src/test/java/as/ASVariableTests.java
@@ -132,6 +132,32 @@ public class ASVariableTests extends ASFeatureTestsBase
compileAndRun(source);
}
+ @Test
+ public void ASVariableTests_localVarSameNameAsPrivateMethod()
+ {
+ // all tests can assume that flash.display.Sprite
+ // flash.system.System and flash.events.Event have been imported
+ String[] imports = new String[]
+ {
+ };
+ String[] declarations = new String[]
+ {
+ "private function isVertical():Boolean { return false; }",
+ };
+ String[] testCode = new String[]
+ {
+ // this threw an exception when the generated code
+ // tried to call the value of the local var.
+ // mxmlc will generate a call to the method
+ // without require a this.isVertical to reference
+ // the instance method.
+ "var isVertical:Boolean = isVertical();",
+ "assertEqual('null', isVertical, false);",
+ };
+ String source = getAS(imports, declarations, testCode, new String[0]);
+ compileAndRun(source, false, false, false, new String[]{ "-compiler.mxml.compatibility-version=4.6.0" } );
+ }
+
/*
public void ASVariableTests_VectorInitializer()
{
[3/7] git commit: [flex-falcon] [refs/heads/develop] - tune up
approval script
Posted by ah...@apache.org.
tune up approval script
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/f4643949
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/f4643949
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/f4643949
Branch: refs/heads/develop
Commit: f464394962106e8dfccda20e94b1adf275543cba
Parents: 2f6f611
Author: Alex Harui <ah...@apache.org>
Authored: Thu Aug 18 23:22:16 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Aug 23 22:01:59 2016 -0700
----------------------------------------------------------------------
ApproveFalcon.xml | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f4643949/ApproveFalcon.xml
----------------------------------------------------------------------
diff --git a/ApproveFalcon.xml b/ApproveFalcon.xml
index 6d308f3..408be37 100644
--- a/ApproveFalcon.xml
+++ b/ApproveFalcon.xml
@@ -300,6 +300,7 @@
<exclude name="debugger/META-INF/MANIFEST.MF"/>
<exclude name="flex-typedefs/target/maven-shared-archive-resources/META-INF/DEPENDENCIES"/>
<exclude name="**/*.patch"/>
+ <exclude name="README_MAVEN.txt"/>
<exclude name="RELEASE_NOTES_JX"/>
<exclude name="LICENSE.jx.bin"/>
<exclude name="NOTICE.jx"/>
@@ -372,6 +373,7 @@
<exclude name="flex-typedefs/target/maven-shared-archive-resources/META-INF/DEPENDENCIES"/>
<exclude name="**/*.patch"/>
<exclude name="LICENSE.jx.bin"/>
+ <exclude name="README_MAVEN.txt"/>
<exclude name="RELEASE_NOTES_JX"/>
<exclude name="NOTICE.jx"/>
<exclude name="README_JX"/>
[6/7] git commit: [flex-falcon] [refs/heads/develop] - allow for
tests to expect errors
Posted by ah...@apache.org.
allow for tests to expect errors
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/aeabcbc3
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/aeabcbc3
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/aeabcbc3
Branch: refs/heads/develop
Commit: aeabcbc3e90b54e1d9e0835449462cbcf20b2d2b
Parents: 2782237
Author: Alex Harui <ah...@apache.org>
Authored: Tue Aug 23 08:26:48 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Aug 23 22:02:00 2016 -0700
----------------------------------------------------------------------
.../src/test/java/as/ASFeatureTestsBase.java | 166 +++++++++++--------
compiler/src/test/java/as/ASVariableTests.java | 5 +-
2 files changed, 97 insertions(+), 74 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/aeabcbc3/compiler/src/test/java/as/ASFeatureTestsBase.java
----------------------------------------------------------------------
diff --git a/compiler/src/test/java/as/ASFeatureTestsBase.java b/compiler/src/test/java/as/ASFeatureTestsBase.java
index 4accbec..730f45a 100644
--- a/compiler/src/test/java/as/ASFeatureTestsBase.java
+++ b/compiler/src/test/java/as/ASFeatureTestsBase.java
@@ -47,87 +47,109 @@ public class ASFeatureTestsBase
{
private static final String NAMESPACE_2009 = "http://ns.adobe.com/mxml/2009";
- protected void compileAndRun(String source, boolean withFramework, boolean withRPC, boolean withSpark, String[] otherOptions)
+ protected File generateTempFile(String source)
{
- System.out.println("Generating test:");
+ // Write the MXML into a temp file.
+ ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
+ String tempDir = testAdapter.getTempDir();
+ File tempASFile = null;
+ try
+ {
+ tempASFile = File.createTempFile(getClass().getSimpleName(), ".as", new File(tempDir));
+ tempASFile.deleteOnExit();
- // Write the MXML into a temp file.
- ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
- String tempDir = testAdapter.getTempDir();
- File tempASFile = null;
- try
- {
- tempASFile = File.createTempFile(getClass().getSimpleName(), ".as", new File(tempDir));
- tempASFile.deleteOnExit();
-
- BufferedWriter out = new BufferedWriter(new FileWriter(tempASFile));
- String className = tempASFile.getName();
- // chop off .as
- className = className.substring(0, className.length() - 3);
-
- source = source.replaceAll("%0", className);
- out.write(source);
- out.close();
- }
- catch (IOException e1)
- {
- e1.printStackTrace();
- fail("Error generating test code");
- }
+ BufferedWriter out = new BufferedWriter(new FileWriter(tempASFile));
+ String className = tempASFile.getName();
+ // chop off .as
+ className = className.substring(0, className.length() - 3);
+
+ source = source.replaceAll("%0", className);
+ out.write(source);
+ out.close();
+ }
+ catch (IOException e1)
+ {
+ e1.printStackTrace();
+ fail("Error generating test code");
+ }
+ return tempASFile;
+ }
+
+ protected String compile(File tempASFile, String source, boolean withFramework, boolean withRPC, boolean withSpark, String[] otherOptions, boolean checkExitCode)
+ {
+ System.out.println("Generating test:");
- // Build the list of SWCs to compile against on the library path.
- List<String> swcs = new ArrayList<String>();
- if (withFramework)
- {
- swcs.add(testAdapter.getFlexArtifact("framework").getPath());
- swcs.add(testAdapter.getFlexArtifactResourceBundle("framework").getPath());
- }
- if (withRPC)
- {
- swcs.add(testAdapter.getFlexArtifact("rpc").getPath());
- swcs.add(testAdapter.getFlexArtifactResourceBundle("rpc").getPath());
- }
- if (withSpark)
- {
- swcs.add(testAdapter.getFlexArtifact("spark").getPath());
- swcs.add(testAdapter.getFlexArtifactResourceBundle("spark").getPath());
- }
+ ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
+ // Build the list of SWCs to compile against on the library path.
+ List<String> swcs = new ArrayList<String>();
+ if (withFramework)
+ {
+ swcs.add(testAdapter.getFlexArtifact("framework").getPath());
+ swcs.add(testAdapter.getFlexArtifactResourceBundle("framework").getPath());
+ }
+ if (withRPC)
+ {
+ swcs.add(testAdapter.getFlexArtifact("rpc").getPath());
+ swcs.add(testAdapter.getFlexArtifactResourceBundle("rpc").getPath());
+ }
+ if (withSpark)
+ {
+ swcs.add(testAdapter.getFlexArtifact("spark").getPath());
+ swcs.add(testAdapter.getFlexArtifactResourceBundle("spark").getPath());
+ }
- List<String> args = new ArrayList<String>();
- args.add("-external-library-path=" + testAdapter.getPlayerglobal().getPath());
- if(swcs.size() > 0) {
- String libraryPath = "-library-path=" + StringUtils.join(swcs.toArray(new String[swcs.size()]), ",");
- args.add(libraryPath);
- }
- if (withFramework || withRPC || withSpark)
- args.add("-namespace=" + NAMESPACE_2009 + "," + testAdapter.getFlexManifestPath("mxml-2009"));
- if (otherOptions != null)
- {
- Collections.addAll(args, otherOptions);
- }
- args.add(tempASFile.getAbsolutePath());
+ List<String> args = new ArrayList<String>();
+ args.add("-external-library-path=" + testAdapter.getPlayerglobal().getPath());
+ if(swcs.size() > 0) {
+ String libraryPath = "-library-path=" + StringUtils.join(swcs.toArray(new String[swcs.size()]), ",");
+ args.add(libraryPath);
+ }
+ if (withFramework || withRPC || withSpark)
+ args.add("-namespace=" + NAMESPACE_2009 + "," + testAdapter.getFlexManifestPath("mxml-2009"));
+ if (otherOptions != null)
+ {
+ Collections.addAll(args, otherOptions);
+ }
+ args.add(tempASFile.getAbsolutePath());
- // Use MXMLC to compile the MXML file against playerglobal.swc and possibly other SWCs.
- MXMLC mxmlc = new MXMLC();
- StringBuffer cmdLine = new StringBuffer();
- for(String arg : args) {
- cmdLine.append(arg).append(" ");
- }
- System.out.println("Compiling test:\n" + cmdLine.toString());
- int exitCode = mxmlc.mainNoExit(args.toArray(new String[args.size()]));
+ // Use MXMLC to compile the MXML file against playerglobal.swc and possibly other SWCs.
+ MXMLC mxmlc = new MXMLC();
+ StringBuffer cmdLine = new StringBuffer();
+ for(String arg : args) {
+ cmdLine.append(arg).append(" ");
+ }
+
+ System.out.println("Compiling test:\n" + cmdLine.toString());
+ int exitCode = mxmlc.mainNoExit(args.toArray(new String[args.size()]));
- // Check that there were no compilation problems.
- List<ICompilerProblem> problems = mxmlc.getProblems().getProblems();
- StringBuilder sb = new StringBuilder("Unxpected compilation problems:\n");
- for (ICompilerProblem problem : problems)
- {
- sb.append(problem.toString());
- sb.append('\n');
- }
+ // Check that there were no compilation problems.
+ List<ICompilerProblem> problems = mxmlc.getProblems().getProblems();
+ StringBuilder sb = new StringBuilder(checkExitCode ? "Unexpected compilation problems:\n" : "");
+ for (ICompilerProblem problem : problems)
+ {
+ sb.append(problem.toString());
+ sb.append('\n');
+ }
System.out.println("After compile:\n" + sb.toString());
- assertThat(sb.toString(), exitCode, is(0));
+ if (checkExitCode)
+ assertThat(sb.toString(), exitCode, is(0));
+ return sb.toString();
+ }
+
+ protected void compileAndExpectErrors(String source, boolean withFramework, boolean withRPC, boolean withSpark, String[] otherOptions, String errors)
+ {
+ File tempASFile = generateTempFile(source);
+ String results = compile(tempASFile, source, withFramework, withRPC, withSpark, otherOptions, false);
+ assertThat(results, is(errors));
+ }
+ protected void compileAndRun(String source, boolean withFramework, boolean withRPC, boolean withSpark, String[] otherOptions)
+ {
+ int exitCode = 0;
+ File tempASFile = generateTempFile(source);
+ compile(tempASFile, source, withFramework, withRPC, withSpark, otherOptions, true);
+ ITestAdapter testAdapter = TestAdapterFactory.getTestAdapter();
// Check the existence of the flashplayer executable
File playerExecutable = testAdapter.getFlashplayerDebugger();
if(!playerExecutable.isFile() || !playerExecutable.exists()) {
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/aeabcbc3/compiler/src/test/java/as/ASVariableTests.java
----------------------------------------------------------------------
diff --git a/compiler/src/test/java/as/ASVariableTests.java b/compiler/src/test/java/as/ASVariableTests.java
index b877fcc..21508fc 100644
--- a/compiler/src/test/java/as/ASVariableTests.java
+++ b/compiler/src/test/java/as/ASVariableTests.java
@@ -107,7 +107,7 @@ public class ASVariableTests extends ASFeatureTestsBase
}
@Test
- public void ASVariableTests_localVarSameNameAsPrivateMethod()
+ public void ASVariableTests_localVarSameNameAsPrivateMethodError()
{
// all tests can assume that flash.display.Sprite
// flash.system.System and flash.events.Event have been imported
@@ -129,7 +129,8 @@ public class ASVariableTests extends ASFeatureTestsBase
"assertEqual('null', isVertical, false);",
};
String source = getAS(imports, declarations, testCode, new String[0]);
- compileAndRun(source);
+ compileAndExpectErrors(source, false, false, false, new String[0],
+ "Call to isVertical is not a function.\n");
}
@Test
[2/7] git commit: [flex-falcon] [refs/heads/develop] - add full text
of svg.js license
Posted by ah...@apache.org.
add full text of svg.js license
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/864ce434
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/864ce434
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/864ce434
Branch: refs/heads/develop
Commit: 864ce43438545cf35998872af719aad2784d6e0d
Parents: f464394
Author: Alex Harui <ah...@apache.org>
Authored: Sat Aug 20 00:01:56 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Aug 23 22:01:59 2016 -0700
----------------------------------------------------------------------
LICENSE.jx.bin | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/864ce434/LICENSE.jx.bin
----------------------------------------------------------------------
diff --git a/LICENSE.jx.bin b/LICENSE.jx.bin
index 89f5bbd..f6a69f7 100644
--- a/LICENSE.jx.bin
+++ b/LICENSE.jx.bin
@@ -28,3 +28,28 @@ flex-typedefs/js/target/downloads/svg.js
This product bundles svg.js from closureidl.googlecode.com available
under the BSD 3-Clause license.
+Copyright (c) 2012, Denis Zawada
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of the <organization> nor the
+ names of its contributors may be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
[5/7] git commit: [flex-falcon] [refs/heads/develop] - update link in
approval script
Posted by ah...@apache.org.
update link in approval script
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/7f3621a0
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/7f3621a0
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/7f3621a0
Branch: refs/heads/develop
Commit: 7f3621a042291d873f6a4755eb75c6ed7eb9777d
Parents: 864ce43
Author: Alex Harui <ah...@apache.org>
Authored: Sat Aug 20 07:32:46 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Aug 23 22:01:59 2016 -0700
----------------------------------------------------------------------
ApproveFalcon.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/7f3621a0/ApproveFalcon.xml
----------------------------------------------------------------------
diff --git a/ApproveFalcon.xml b/ApproveFalcon.xml
index 408be37..b732e29 100644
--- a/ApproveFalcon.xml
+++ b/ApproveFalcon.xml
@@ -111,7 +111,7 @@
unless="release.version"/>
<condition property="package.url.path"
- value="http://apacheflexbuild.cloudapp.net:8080/job/flex-falcon/lastSuccessfulBuild/artifact/out">
+ value="http://apacheflexbuild.cloudapp.net:8080/job/flex-falcon%20release%20branch/lastSuccessfulBuild/artifact/out">
<not>
<isset property="rc" />
</not>
[7/7] git commit: [flex-falcon] [refs/heads/develop] - fix a few bugs
in the CallNonFunctionProblem logic
Posted by ah...@apache.org.
fix a few bugs in the CallNonFunctionProblem logic
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/ced58cc2
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/ced58cc2
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/ced58cc2
Branch: refs/heads/develop
Commit: ced58cc231ea1784cefb30511609df1cbad02d91
Parents: aeabcbc
Author: Alex Harui <ah...@apache.org>
Authored: Tue Aug 23 22:01:40 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Aug 23 22:02:00 2016 -0700
----------------------------------------------------------------------
.../compiler/internal/semantics/MethodBodySemanticChecker.java | 1 +
.../org/apache/flex/compiler/internal/tree/as/IdentifierNode.java | 2 ++
2 files changed, 3 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ced58cc2/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/MethodBodySemanticChecker.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/MethodBodySemanticChecker.java b/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/MethodBodySemanticChecker.java
index 04eb040..43999de 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/MethodBodySemanticChecker.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/MethodBodySemanticChecker.java
@@ -855,6 +855,7 @@ public class MethodBodySemanticChecker
VariableDefinition varDef = (VariableDefinition)def;
IDefinition varType = varDef.resolveType(project);
if (varType == null || // Null here means the ANY_TYPE
+ varType.equals(project.getBuiltinType(BuiltinType.CLASS)) ||
varType.equals(project.getBuiltinType(BuiltinType.FUNCTION)) ||
varType.equals(project.getBuiltinType(BuiltinType.OBJECT)) ||
varType.equals(project.getBuiltinType(BuiltinType.ANY_TYPE)))
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ced58cc2/compiler/src/main/java/org/apache/flex/compiler/internal/tree/as/IdentifierNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/internal/tree/as/IdentifierNode.java b/compiler/src/main/java/org/apache/flex/compiler/internal/tree/as/IdentifierNode.java
index da50f5d..3642c05 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/internal/tree/as/IdentifierNode.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/internal/tree/as/IdentifierNode.java
@@ -1036,6 +1036,8 @@ public class IdentifierNode extends ExpressionNodeBase implements IIdentifierNod
public boolean isLegacyCodegen(ICompilerProject project)
{
+ if (!(project instanceof FlexProject))
+ return false;
final Integer compatibilityVersion = ((FlexProject)project).getCompatibilityVersion();
if (compatibilityVersion == null)
return false;
[4/7] git commit: [flex-falcon] [refs/heads/develop] - detect calls
to nonFunctions
Posted by ah...@apache.org.
detect calls to nonFunctions
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/1642c4ea
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/1642c4ea
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/1642c4ea
Branch: refs/heads/develop
Commit: 1642c4ea15225eb972772473fafad459bf64c1a9
Parents: 7f3621a
Author: Alex Harui <ah...@apache.org>
Authored: Mon Aug 22 07:47:26 2016 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Aug 23 22:01:59 2016 -0700
----------------------------------------------------------------------
.../semantics/MethodBodySemanticChecker.java | 16 ++++++++
.../problems/CallNonFunctionProblem.java | 42 ++++++++++++++++++++
compiler/src/test/java/as/ASVariableTests.java | 26 ++++++++++++
3 files changed, 84 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/1642c4ea/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/MethodBodySemanticChecker.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/MethodBodySemanticChecker.java b/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/MethodBodySemanticChecker.java
index c91fcf4..04eb040 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/MethodBodySemanticChecker.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/internal/semantics/MethodBodySemanticChecker.java
@@ -850,6 +850,22 @@ public class MethodBodySemanticChecker
FunctionDefinition func = (FunctionDefinition)def;
checkFormalsVsActuals(iNode, func, actuals);
}
+ else if ( def instanceof VariableDefinition )
+ {
+ VariableDefinition varDef = (VariableDefinition)def;
+ IDefinition varType = varDef.resolveType(project);
+ if (varType == null || // Null here means the ANY_TYPE
+ varType.equals(project.getBuiltinType(BuiltinType.FUNCTION)) ||
+ varType.equals(project.getBuiltinType(BuiltinType.OBJECT)) ||
+ varType.equals(project.getBuiltinType(BuiltinType.ANY_TYPE)))
+ {
+ // assume it can be called
+ }
+ else
+ {
+ addProblem(new CallNonFunctionProblem(iNode, method_binding.getName().getBaseName()));
+ }
+ }
else if ( def == project.getBuiltinType(BuiltinType.ARRAY) )
{
// Warn about calling Array as a function because developers
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/1642c4ea/compiler/src/main/java/org/apache/flex/compiler/problems/CallNonFunctionProblem.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/problems/CallNonFunctionProblem.java b/compiler/src/main/java/org/apache/flex/compiler/problems/CallNonFunctionProblem.java
new file mode 100644
index 0000000..50f075c
--- /dev/null
+++ b/compiler/src/main/java/org/apache/flex/compiler/problems/CallNonFunctionProblem.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.flex.compiler.problems;
+
+import org.apache.flex.compiler.tree.as.IASNode;
+
+/**
+ * Strict semantics diagnostic emitted when the method body
+ * semantic checker detects a call to function that isn't of type function.
+ */
+public final class CallNonFunctionProblem extends StrictSemanticsProblem
+{
+ public static final String DESCRIPTION =
+ "Call to ${methodName} is not a function.";
+
+ public static final int errorCode = 1181;
+
+ public CallNonFunctionProblem(IASNode node, String methodName)
+ {
+ super(node);
+ this.methodName = methodName;
+ }
+
+ public final String methodName;
+}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/1642c4ea/compiler/src/test/java/as/ASVariableTests.java
----------------------------------------------------------------------
diff --git a/compiler/src/test/java/as/ASVariableTests.java b/compiler/src/test/java/as/ASVariableTests.java
index 10314d9..f4684fd 100644
--- a/compiler/src/test/java/as/ASVariableTests.java
+++ b/compiler/src/test/java/as/ASVariableTests.java
@@ -106,6 +106,32 @@ public class ASVariableTests extends ASFeatureTestsBase
compileAndRun(source);
}
+ @Test
+ public void ASVariableTests_localVarSameNameAsPrivateMethod()
+ {
+ // all tests can assume that flash.display.Sprite
+ // flash.system.System and flash.events.Event have been imported
+ String[] imports = new String[]
+ {
+ };
+ String[] declarations = new String[]
+ {
+ "private function isVertical():Boolean { return false; }",
+ };
+ String[] testCode = new String[]
+ {
+ // this threw an exception when the generated code
+ // tried to call the value of the local var.
+ // mxmlc will generate a call to the method
+ // without require a this.isVertical to reference
+ // the instance method.
+ "var isVertical:Boolean = isVertical();",
+ "assertEqual('null', isVertical, false);",
+ };
+ String source = getAS(imports, declarations, testCode, new String[0]);
+ compileAndRun(source);
+ }
+
/*
public void ASVariableTests_VectorInitializer()
{