quickjs-android icon indicating copy to clipboard operation
quickjs-android copied to clipboard

大佬 quickjs 有啥异步交互的api能用吗 promise await 都不支持?有其他能用的异步方案吗

Open miaotaoii opened this issue 3 years ago • 1 comments

miaotaoii avatar Dec 12 '22 08:12 miaotaoii

可以这样

举例:

var requestParams = { "p1": "11" };
native.request("getHomeList", requestParams, function (e) {
    native.log("response:" + JSON.stringify(e));
});

当参数为方法时,参数为JSFunction,然后持有这个引用call调用就好了

((JSFunction) args.get(2)).call(receiver, new JSArray(jsContext).push(111111));

wu928320442 avatar Feb 23 '23 05:02 wu928320442