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 2017/11/17 18:47:08 UTC
[royale-compiler] 02/03: eliminate warnings in output
This is an automated email from the ASF dual-hosted git repository.
aharui pushed a commit to branch feature/rename
in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
commit c195a29a3ec167a4bdb9d779b3f6f3b8e18f9cbe
Author: Alex Harui <ah...@apache.org>
AuthorDate: Fri Nov 17 10:05:26 2017 -0800
eliminate warnings in output
---
.../codegen/typedefs/TestExternJSMissing.java | 2 ++
.../typedefs/unit_tests/constructor_params.js | 3 ++-
.../imports/import_constructor_signatures.js | 7 ++++++-
.../unit_tests/imports/import_functions.js | 7 ++++++-
.../unit_tests/imports/import_interfaces.js | 9 +++++++--
.../unit_tests/imports/import_method_signatures.js | 7 ++++++-
.../unit_tests/imports/import_superclasses.js | 12 ++++++++---
.../test/resources/typedefs/unit_tests/missing.js | 23 +---------------------
.../typedefs/unit_tests/package_namespace.js | 2 +-
9 files changed, 40 insertions(+), 32 deletions(-)
diff --git a/compiler-externc/src/test/java/org/apache/royale/compiler/internal/codegen/typedefs/TestExternJSMissing.java b/compiler-externc/src/test/java/org/apache/royale/compiler/internal/codegen/typedefs/TestExternJSMissing.java
index 32bbc2c..8237fc2 100644
--- a/compiler-externc/src/test/java/org/apache/royale/compiler/internal/codegen/typedefs/TestExternJSMissing.java
+++ b/compiler-externc/src/test/java/org/apache/royale/compiler/internal/codegen/typedefs/TestExternJSMissing.java
@@ -103,6 +103,8 @@ public class TestExternJSMissing extends ExternalsTestBase
ExternalsTestUtils.init();
config.setASRoot(ExternalsTestUtils.AS_ROOT_DIR);
+ String coreRoot = ExternalsTestUtils.EXTERNAL_JS_DIR.getAbsolutePath();
+ config.addExternal(coreRoot + "/es3.js");
config.addExternal(ExternalsTestUtils.MISSING_JS_FILE);
}
}
diff --git a/compiler-externc/src/test/resources/typedefs/unit_tests/constructor_params.js b/compiler-externc/src/test/resources/typedefs/unit_tests/constructor_params.js
index 2e8d7eb..953e84c 100644
--- a/compiler-externc/src/test/resources/typedefs/unit_tests/constructor_params.js
+++ b/compiler-externc/src/test/resources/typedefs/unit_tests/constructor_params.js
@@ -61,7 +61,8 @@ function FooOptVarArgs(arg1, opt_arg2, var_args) {}
*
* @constructor
*/
-AssignFooNoArgs = function () {};
+// this pattern results in warnings and may no longer be allowed by Closure Compiler
+// AssignFooNoArgs = function () {};
/**
* A constructor with no args.
diff --git a/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_constructor_signatures.js b/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_constructor_signatures.js
index 9f80e7e..fbb8c5d 100644
--- a/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_constructor_signatures.js
+++ b/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_constructor_signatures.js
@@ -25,7 +25,12 @@
* @param {number} value
* @param {foo.Baz?} baz
*/
-ImportConstructorSignature = function(qux, bar, value, baz) {};
+function ImportConstructorSignature(qux, bar, value, baz) {};
+
+/**
+ * @const
+ */
+var foo = {};
/**
* @constructor
diff --git a/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_functions.js b/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_functions.js
index b6c170b..abd6114 100644
--- a/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_functions.js
+++ b/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_functions.js
@@ -29,7 +29,12 @@ function ImportFunction(bar, baz, quux) {}
/**
* @constructor
*/
-Quux = function() {};
+function Quux() {};
+
+/**
+ * @const
+ */
+var foo = {};
/**
* @constructor
diff --git a/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_interfaces.js b/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_interfaces.js
index 97a711f..2316491 100644
--- a/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_interfaces.js
+++ b/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_interfaces.js
@@ -22,13 +22,18 @@
* @implements {Qux}
* @implements {API.Foo}
*/
-ImportInterfaces = function() {};
+function ImportInterfaces() {};
/**
* @interface
*/
-Qux = function() {};
+function Qux() {};
+
+/**
+ * @const
+ */
+var API = {};
/**
* @interface
diff --git a/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_method_signatures.js b/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_method_signatures.js
index 6524dc5..43a29cf 100644
--- a/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_method_signatures.js
+++ b/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_method_signatures.js
@@ -20,7 +20,7 @@
/**
* @constructor
*/
-ImportMethodSignature = function() {};
+function ImportMethodSignature() {};
/**
* @param {foo.Quux|foo.Bar} bar
@@ -46,6 +46,11 @@ ImportMethodSignature.prototype.myMethodWithReturnType = function(bar, value, ba
ImportMethodSignature.myMethodWithUnionReturnType = function(bar, value, baz) {};
/**
+ * @const
+ */
+var foo = {};
+
+/**
* @constructor
*/
foo.Bar = function() {};
diff --git a/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_superclasses.js b/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_superclasses.js
index 1a549d7..52b3986 100644
--- a/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_superclasses.js
+++ b/compiler-externc/src/test/resources/typedefs/unit_tests/imports/import_superclasses.js
@@ -21,18 +21,24 @@
* @constructor
* @extends {Qux}
*/
-ImportSuperClass1 = function() {};
+function ImportSuperClass1() {};
/**
* @constructor
* @extends {BASE.Foo}
*/
-ImportSuperClass2 = function() {};
+function ImportSuperClass2() {};
/**
* @constructor
*/
-Qux = function() {};
+function Qux () {};
+
+/**
+ * @const
+ */
+var BASE = {};
+
/**
* @constructor
diff --git a/compiler-externc/src/test/resources/typedefs/unit_tests/missing.js b/compiler-externc/src/test/resources/typedefs/unit_tests/missing.js
index 77c7791..e287cee 100644
--- a/compiler-externc/src/test/resources/typedefs/unit_tests/missing.js
+++ b/compiler-externc/src/test/resources/typedefs/unit_tests/missing.js
@@ -17,6 +17,7 @@
*
*/
+// this is a subset of the one in royale-typedefs/js. It is only used to build a test version
// webkit_notifications
/**
@@ -37,22 +38,6 @@ function HTMLEmbedElement() {};
var window;
/**
- * @type {!HTMLDocument}
- */
-Window.prototype.document;
-
-/**
- * resolveLocalFileSystemURI has been deprecated; this is the replacement.
- * @see http://www.w3.org/TR/file-system-api/#widl-LocalFileSystem-resolveLocalFileSystemURL
- * @param {string} url
- * @param {function(!Entry)} successCallback
- * @param {function(!FileError)=} errorCallback
- */
-Window.prototype.resolveLocalFileSystemURL = function(url, successCallback,
- errorCallback) {}
-
-
-/**
* @constructor
*/
function dialogPolyfill() {};
@@ -145,12 +130,6 @@ function History() {}
function Location() {}
/**
- * @type {number}
- */
-XMLHttpRequest.prototype.timeout;
-
-
-/**
* @export
* This gets mapped to org.apache.royale.utils.Language.trace() by the compiler
* @param {...} rest
diff --git a/compiler-externc/src/test/resources/typedefs/unit_tests/package_namespace.js b/compiler-externc/src/test/resources/typedefs/unit_tests/package_namespace.js
index 3ea2fbf..3d0cfe3 100644
--- a/compiler-externc/src/test/resources/typedefs/unit_tests/package_namespace.js
+++ b/compiler-externc/src/test/resources/typedefs/unit_tests/package_namespace.js
@@ -20,7 +20,7 @@
/**
* @constructor
*/
-Foo = function () {};
+function Foo () {};
/**
* @const
--
To stop receiving notification emails like this one, please contact
"commits@royale.apache.org" <co...@royale.apache.org>.