I'm trying to await a custom global JavaScript function:
var promise = js.context.callMethod('performAuthenticationInNewWindow', [uri.toString()]);
print(promise);
var qs = await promiseToFuture(promise);
Which prints the following:
[object Promise]
NoSuchMethodError: tried to call a non-function, such as null: 'jsPromise.then'