From 01734f38d14d99f059453b00cf7b517df2601b11 Mon Sep 17 00:00:00 2001 From: Michael Gratton Date: Fri, 1 Mar 2019 20:26:10 +1100 Subject: [PATCH] Apply same workaround for s390x to client code as for the web extension Apply workaround in 719b3a19 to remaing similar calls in client codebase. Fixes #260 --- .../conversation-viewer/conversation-web-view.vala | 3 ++- src/client/util/util-webkit.vala | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/client/conversation-viewer/conversation-web-view.vala b/src/client/conversation-viewer/conversation-web-view.vala index 48b92317d..e46158f04 100644 --- a/src/client/conversation-viewer/conversation-web-view.vala +++ b/src/client/conversation-viewer/conversation-web-view.vala @@ -206,7 +206,8 @@ public class ConversationWebView : ClientWebView { private void on_deceptive_link_clicked(WebKit.JavascriptResult result) { try { - unowned JS.GlobalContext context = result.get_global_context(); + unowned JS.GlobalContext context = + (JS.GlobalContext) result.get_global_context(); JS.Object details = WebKitUtil.to_object(result); uint reason = (uint) Geary.JS.to_number( diff --git a/src/client/util/util-webkit.vala b/src/client/util/util-webkit.vala index 45a27c44d..4957d1eea 100644 --- a/src/client/util/util-webkit.vala +++ b/src/client/util/util-webkit.vala @@ -18,7 +18,8 @@ namespace WebKitUtil { */ public bool to_bool(WebKit.JavascriptResult result) throws Geary.JS.Error { - unowned JS.GlobalContext context = result.get_global_context(); + unowned JS.GlobalContext context = + (JS.GlobalContext) result.get_global_context(); unowned JS.Value value = result.get_value(); if (!value.is_boolean(context)) { throw new Geary.JS.Error.TYPE("Result is not a JS Boolean object"); @@ -34,7 +35,7 @@ namespace WebKitUtil { */ public inline double to_number(WebKit.JavascriptResult result) throws Geary.JS.Error { - return Geary.JS.to_number(result.get_global_context(), + return Geary.JS.to_number((JS.GlobalContext) result.get_global_context(), result.get_value()); } @@ -46,7 +47,7 @@ namespace WebKitUtil { */ public inline string to_string(WebKit.JavascriptResult result) throws Geary.JS.Error { - return Geary.JS.to_string(result.get_global_context(), + return Geary.JS.to_string((JS.GlobalContext) result.get_global_context(), result.get_value()); } @@ -59,7 +60,8 @@ namespace WebKitUtil { */ public string as_string(WebKit.JavascriptResult result) throws Geary.JS.Error { - unowned JS.GlobalContext context = result.get_global_context(); + unowned JS.GlobalContext context = + (JS.GlobalContext) result.get_global_context(); unowned JS.Value js_str_value = result.get_value(); JS.Value? err = null; JS.String js_str = js_str_value.to_string_copy(context, out err); @@ -78,7 +80,7 @@ namespace WebKitUtil { */ public JS.Object? to_object(WebKit.JavascriptResult result) throws Geary.JS.Error { - return Geary.JS.to_object(result.get_global_context(), + return Geary.JS.to_object((JS.GlobalContext) result.get_global_context(), result.get_value()); } -- GitLab