Fix compilation for clang. Bug 778046

This commit is contained in:
Gautier Pelloux-Prayer 2017-02-03 15:20:20 +01:00 committed by Michael James Gratton
parent 37abad559a
commit 330f897f8c
3 changed files with 15 additions and 4 deletions

View file

@ -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());

View file

@ -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__");

View file

@ -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 {