flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [11/19] git commit: [flex-falcon] [refs/heads/develop] - suppress expected errors
Date Wed, 25 May 2016 18:25:18 GMT
suppress expected 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/b262713f
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/b262713f
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/b262713f

Branch: refs/heads/develop
Commit: b262713fb3ec693a0dd382c51ee13f0416fb738b
Parents: 58e39c0
Author: Alex Harui <aharui@apache.org>
Authored: Tue May 24 12:09:14 2016 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Tue May 24 21:08:03 2016 -0700

----------------------------------------------------------------------
 .../externals/pass/ReferenceCompiler.java       | 75 ++++++++++++++++++++
 1 file changed, 75 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/b262713f/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/ReferenceCompiler.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/ReferenceCompiler.java
b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/ReferenceCompiler.java
index dc83314..e588075 100644
--- a/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/ReferenceCompiler.java
+++ b/compiler-jx/src/main/java/org/apache/flex/compiler/internal/codegen/externals/pass/ReferenceCompiler.java
@@ -85,9 +85,15 @@ public class ReferenceCompiler
         //compiler.setErrorManager(testErrorManager);
         jscompiler.initOptions(options);
 
+        jscompiler.setErrorManager(wrapErrorManager(jscompiler.getErrorManager()));
         model.setJSCompiler(jscompiler);
     }
 
+    public ErrorManager wrapErrorManager(ErrorManager em)
+    {
+    	return new ReferenceErrorManager(em);
+    }
+    
     public Result compile() throws IOException
     {
         List<SourceFile> sources = new ArrayList<SourceFile>();
@@ -132,4 +138,73 @@ public class ReferenceCompiler
             return FilenameUtils.getBaseName(getFile().getAbsolutePath());
         }
     }
+    
+    public static class ReferenceErrorManager implements ErrorManager
+    {
+    	public ReferenceErrorManager(ErrorManager em)
+    	{
+    		this.em = em;
+    	}
+    	
+    	private ErrorManager em;
+
+		@Override
+		public void generateReport() {
+			em.generateReport();
+		}
+
+		@Override
+		public int getErrorCount() {
+			int num = em.getErrorCount();
+			if (num > 0)
+			{
+				num = 0;
+			}
+			return num;
+		}
+
+		@Override
+		public JSError[] getErrors() {
+			return em.getErrors();
+		}
+
+		@Override
+		public double getTypedPercent() {
+			return em.getTypedPercent();
+		}
+
+		@Override
+		public int getWarningCount() {
+			return em.getWarningCount();
+		}
+
+		@Override
+		public JSError[] getWarnings() {
+			return em.getWarnings();
+		}
+
+		@Override
+		public void report(CheckLevel arg0, JSError arg1) {
+			if (arg1.description.equals("Parse error. identifier is a reserved word"))
+			{
+				if (arg1.sourceName.equals("[missing]"))
+				{
+					if (arg1.lineNumber == 101 ||
+							arg1.lineNumber == 107 ||
+							arg1.lineNumber == 232 ||
+							arg1.lineNumber == 239)
+					{
+						return;
+					}
+				}
+			}
+			em.report(arg0, arg1);
+		}
+
+		@Override
+		public void setTypedPercent(double arg0) {
+			em.setTypedPercent(arg0);
+		}
+    	
+    }
 }


Mime
View raw message