flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject git commit: [flex-falcon] [refs/heads/develop] - get rid of more warnings by choosing es6 for the externs
Date Wed, 25 May 2016 19:24:22 GMT
Repository: flex-falcon
Updated Branches:
  refs/heads/develop 791c65b19 -> f34175887


get rid of more warnings by choosing es6 for the externs


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

Branch: refs/heads/develop
Commit: f34175887eddce0581de3489ba6e60de1bc1b254
Parents: 791c65b
Author: Alex Harui <aharui@apache.org>
Authored: Wed May 25 12:18:06 2016 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Wed May 25 12:18:06 2016 -0700

----------------------------------------------------------------------
 .../codegen/externals/pass/ReferenceCompiler.java       |  6 +++++-
 .../internal/codegen/externals/ExternalsTestUtils.java  |  1 +
 .../internal/codegen/externals/TestExternChrome.java    | 12 +++++++++++-
 externs/js/src/main/config/externc-config.xml           |  1 +
 4 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f3417588/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 e588075..2017848 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
@@ -32,6 +32,7 @@ import org.apache.flex.compiler.internal.codegen.externals.reference.ReferenceMo
 import com.google.common.collect.ImmutableList;
 import com.google.javascript.jscomp.*;
 import com.google.javascript.jscomp.Compiler;
+import com.google.javascript.jscomp.CompilerOptions.LanguageMode;
 
 public class ReferenceCompiler
 {
@@ -72,6 +73,8 @@ public class ReferenceCompiler
         options.setParseJsDocDocumentation(true);
         options.setExternExports(false);
         options.setExtraAnnotationNames(Arrays.asList(asdocTags));
+        options.setLanguageIn(LanguageMode.ECMASCRIPT6_STRICT);
+        options.setLanguageIn(LanguageMode.ECMASCRIPT5_STRICT);
 
         options.addCustomPass(CustomPassExecutionTime.BEFORE_OPTIMIZATIONS, new NamespaceResolutionPass(model,
                 jscompiler));
@@ -85,7 +88,8 @@ public class ReferenceCompiler
         //compiler.setErrorManager(testErrorManager);
         jscompiler.initOptions(options);
 
-        jscompiler.setErrorManager(wrapErrorManager(jscompiler.getErrorManager()));
+        // don't need custom error manager with es6->es5 language options
+        //jscompiler.setErrorManager(wrapErrorManager(jscompiler.getErrorManager()));
         model.setJSCompiler(jscompiler);
     }
 

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f3417588/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestUtils.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestUtils.java
b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestUtils.java
index 7d7c9ad..b583465 100644
--- a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestUtils.java
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/ExternalsTestUtils.java
@@ -115,6 +115,7 @@ public class ExternalsTestUtils
         config.addExternal(coreRoot + "/browser/w3c_range.js");
         config.addExternal(coreRoot + "/browser/w3c_rtc.js");
         config.addExternal(coreRoot + "/browser/w3c_selectors.js");
+        config.addExternal(coreRoot + "/browser/w3c_touch_event.js");
         //model.addExternal(coreRoot + "/w3c_serviceworker.js");
         //model.addExternal(coreRoot + "/w3c_webcrypto.js");
         config.addExternal(coreRoot + "/browser/w3c_xml.js");

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f3417588/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternChrome.java
----------------------------------------------------------------------
diff --git a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternChrome.java
b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternChrome.java
index 51afce9..8659690 100644
--- a/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternChrome.java
+++ b/compiler-jx/src/test/java/org/apache/flex/compiler/internal/codegen/externals/TestExternChrome.java
@@ -60,7 +60,7 @@ public class TestExternChrome extends ExternalsTestBase
                 "ChromeLoadTimes",
                 "ChromeCsiInfo" };
 
-        assertEquals(17, model.getClasses().size());
+        assertEquals(248, model.getClasses().size());
         for (String className : classes)
         {
             assertTrue(model.hasClass(className));
@@ -148,6 +148,16 @@ public class TestExternChrome extends ExternalsTestBase
 
         String coreRoot = ExternalsTestUtils.EXTERNAL_JS_DIR.getAbsolutePath();
         config.addExternal(coreRoot + "/browser/chrome.js");
+        config.addExternal(coreRoot + "/browser/html5.js");
+        config.addExternal(coreRoot + "/browser/ie_dom.js");
+        config.addExternal(coreRoot + "/browser/gecko_dom.js");
+        config.addExternal(coreRoot + "/browser/w3c_css.js");
+        config.addExternal(coreRoot + "/browser/w3c_event.js");
+        config.addExternal(coreRoot + "/browser/w3c_range.js");
+        config.addExternal(coreRoot + "/browser/w3c_dom1.js");
+        config.addExternal(coreRoot + "/browser/w3c_dom2.js");
+        config.addExternal(coreRoot + "/browser/w3c_dom3.js");
+        config.addExternal(coreRoot + "/browser/w3c_xml.js");
     }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/f3417588/externs/js/src/main/config/externc-config.xml
----------------------------------------------------------------------
diff --git a/externs/js/src/main/config/externc-config.xml b/externs/js/src/main/config/externc-config.xml
index 498cd27..7eb1dfe 100644
--- a/externs/js/src/main/config/externc-config.xml
+++ b/externs/js/src/main/config/externc-config.xml
@@ -83,6 +83,7 @@
         <path-element>../../../target/downloads/browser/w3c_range.js</path-element>
         <path-element>../../../target/downloads/browser/w3c_rtc.js</path-element>
         <path-element>../../../target/downloads/browser/w3c_selectors.js</path-element>
+        <path-element>../../../target/downloads/browser/w3c_touch_event.js</path-element>
         <!-- path-element>../../../target/downloads/browser/w3c_serviceworker.js</path-element>
-->
         <!-- path-element>../../../target/downloads/browser/w3c_webcrypto.js</path-element>
-->
         <path-element>../../../target/downloads/browser/w3c_xml.js</path-element>


Mime
View raw message