[geary] Fix compilation for clang. Bug 778046



commit 330f897f8c90031cd0e43e86ff99773e0e79e88d
Author: Gautier Pelloux-Prayer <gautier+git damsy net>
Date:   Fri Feb 3 15:20:20 2017 +0100

    Fix compilation for clang. Bug 778046

 src/client/util/util-webkit.vala                  |    5 ++++-
 src/client/web-process/web-process-extension.vala |    4 +++-
 src/engine/util/util-js.vala                      |   10 ++++++++--
 3 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/src/client/util/util-webkit.vala b/src/client/util/util-webkit.vala
index 375c47b..319e28a 100644
--- a/src/client/util/util-webkit.vala
+++ b/src/client/util/util-webkit.vala
@@ -72,8 +72,11 @@ namespace WebKitUtil {
      *
      * This will raise a {@link Geary.JS.Error.TYPE} error if the
      * result is not a JavaScript `Object`.
+     *
+     * Return type is nullable as a workaround for Bug 778046, it will
+     * never actually be null.
      */
-    public JS.Object to_object(WebKit.JavascriptResult result)
+    public JS.Object? to_object(WebKit.JavascriptResult result)
         throws Geary.JS.Error {
         return Geary.JS.to_object(result.get_global_context(),
                                   result.get_value());
diff --git a/src/client/web-process/web-process-extension.vala 
b/src/client/web-process/web-process-extension.vala
index 2eda53c..fba5384 100644
--- a/src/client/web-process/web-process-extension.vala
+++ b/src/client/web-process/web-process-extension.vala
@@ -128,7 +128,9 @@ public class GearyWebExtension : Object {
         }
     }
 
-    private JS.Value execute_script(JS.Context context, string script, int line)
+    // Return type is nullable as a workaround for Bug 778046, it will
+    // never actually be null.
+    private JS.Value? execute_script(JS.Context context, string script, int line)
     throws Geary.JS.Error {
         JS.String js_script = new JS.String.create_with_utf8_cstring(script);
         JS.String js_source = new JS.String.create_with_utf8_cstring("__FILE__");
diff --git a/src/engine/util/util-js.vala b/src/engine/util/util-js.vala
index ad4d94b..4d22429 100644
--- a/src/engine/util/util-js.vala
+++ b/src/engine/util/util-js.vala
@@ -80,8 +80,11 @@ namespace Geary.JS {
      *
      * This will raise a {@link Geary.JS.Error.TYPE} error if the
      * value is not a JavaScript `Object`.
+     *
+     * Return type is nullable as a workaround for Bug 778046, it will
+     * never actually be null.
      */
-    public global::JS.Object to_object(global::JS.Context context,
+    public global::JS.Object? to_object(global::JS.Context context,
                                        global::JS.Value value)
         throws Geary.JS.Error {
         if (!value.is_object(context)) {
@@ -111,8 +114,11 @@ namespace Geary.JS {
      *
      * This will raise a {@link Geary.JS.Error.TYPE} error if the
      * object does not contain the named property.
+     *
+     * Return type is nullable as a workaround for Bug 778046, it will
+     * never actually be null.
      */
-    public inline global::JS.Value get_property(global::JS.Context context,
+    public inline global::JS.Value? get_property(global::JS.Context context,
                                                 global::JS.Object object,
                                                 string name)
         throws Geary.JS.Error {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]