You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2018/10/22 05:43:58 UTC

[royale-compiler] branch develop updated (3151e46 -> 66712cd)

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a change to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git.


    from 3151e46  Revert "avoid generation of the .js.map file in release mode for App.js"
     new 4cc22a0  let local classes (classes in the same file but outside the package) win over global classes
     new 66712cd  try to report an error instead of just crashing

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../royale/compiler/internal/graph/GoogDepsWriter.java   |  5 +++++
 .../royale/compiler/internal/projects/RoyaleProject.java | 16 ++++++++++++++++
 2 files changed, 21 insertions(+)


[royale-compiler] 01/02: let local classes (classes in the same file but outside the package) win over global classes

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit 4cc22a09dbcc9110183e672f32852c0343a1fbf1
Author: Alex Harui <ah...@apache.org>
AuthorDate: Sun Oct 21 22:43:09 2018 -0700

    let local classes (classes in the same file but outside the package) win over global classes
---
 .../royale/compiler/internal/projects/RoyaleProject.java | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProject.java b/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProject.java
index 55f336d..903889d 100644
--- a/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProject.java
+++ b/compiler/src/main/java/org/apache/royale/compiler/internal/projects/RoyaleProject.java
@@ -2169,6 +2169,10 @@ public class RoyaleProject extends ASProject implements IRoyaleProject, ICompile
         String thisPackage = null;
         if (scopeDef != null) 
             thisPackage = scopeDef.getPackageName();
+        else if (scope instanceof ASFileScope)
+        {
+        	thisPackage = "";
+        }
         else
         {
             while (!(scope instanceof PackageScope))
@@ -2208,6 +2212,18 @@ public class RoyaleProject extends ASProject implements IRoyaleProject, ICompile
             // that they meant the one they did import
             if (!usingWindow)
             {
+            	// but if no packages at all first see if it is a local class
+            	if (package1.length() == 0 && package2.length() == 0)
+            	{
+            		if (pkgScope instanceof PackageScope)
+            			pkgScope = pkgScope.getContainingScope();
+            		if (pkgScope.getAllLocalNames().contains(name))
+            		{
+            			IDefinitionSet defSet = pkgScope.getLocalDefinitionSetByName(name);
+            			if (defSet.getSize() == 1)
+            				return defSet.getDefinition(0);
+            		}
+            	}
                 return package1.length() == 0 ? def2 : def1;
             }
             // otherwise fall through to ambiguous because they need to qualify


[royale-compiler] 02/02: try to report an error instead of just crashing

Posted by ah...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git

commit 66712cd32aad488f77e62f821c830bc5e2fafd1f
Author: Alex Harui <ah...@apache.org>
AuthorDate: Sun Oct 21 22:43:35 2018 -0700

    try to report an error instead of just crashing
---
 .../org/apache/royale/compiler/internal/graph/GoogDepsWriter.java    | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/graph/GoogDepsWriter.java b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/graph/GoogDepsWriter.java
index fabfd4a..a6104a0 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/graph/GoogDepsWriter.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/graph/GoogDepsWriter.java
@@ -391,6 +391,11 @@ public class GoogDepsWriter {
 			if (!isGoogClass(className))
 			{
 				GoogDep gd = depMap.get(className);
+				if (gd == null)
+				{
+					System.out.println("No GoogDep for " + className);
+					throw new RuntimeException("Unable to find dependency information for class: " + className);
+				}
 				if (!visited.containsKey(className))
 				{
 					sortFunction(gd, arr);