use native promise constructor

This commit is contained in:
ekibun
2020-09-22 00:32:17 +08:00
parent 15ae27d7b0
commit 29c2b04a36
11 changed files with 128 additions and 71 deletions

View File

@@ -3,7 +3,7 @@
* @Author: ekibun
* @Date: 2020-09-06 18:32:45
* @LastEditors: ekibun
* @LastEditTime: 2020-09-21 18:34:04
* @LastEditTime: 2020-09-22 00:17:02
*/
#include "quickjs/quickjs.h"
#include <functional>
@@ -298,4 +298,9 @@ extern "C"
JSContext *ctx;
return JS_ExecutePendingJob(rt, &ctx);
}
DLLEXPORT JSValue *jsNewPromiseCapability(JSContext *ctx, JSValue *resolving_funcs)
{
return new JSValue{JS_NewPromiseCapability(ctx, resolving_funcs)};
}
}