Update Async.java

pull/586/head
FongMi 1 year ago
parent 80155a09af
commit 1f9a63e909
  1. 2
      quickjs/src/main/java/com/fongmi/quickjs/method/Async.java

@ -24,6 +24,7 @@ public class Async {
Object result = function.call(args);
if (result instanceof JSObject) then(result);
else future.complete(result);
function.release();
return future;
}
@ -36,6 +37,7 @@ public class Async {
JSObject promise = (JSObject) result;
JSFunction then = promise.getJSFunction("then");
if (then != null) then.call(callback);
if (then != null) then.release();
}
private final JSCallFunction callback = new JSCallFunction() {

Loading…
Cancel
Save