mirror of
https://github.com/bellard/quickjs.git
synced 2025-09-30 06:54:26 +03:00
top-level-await support - follow the spec in the implementation of the module linking and evaluation to avoid errors with cycling module dependencies
This commit is contained in:
12
quickjs.h
12
quickjs.h
@@ -831,7 +831,15 @@ typedef struct {
|
||||
void JS_SetSharedArrayBufferFunctions(JSRuntime *rt,
|
||||
const JSSharedArrayBufferFunctions *sf);
|
||||
|
||||
typedef enum JSPromiseStateEnum {
|
||||
JS_PROMISE_PENDING,
|
||||
JS_PROMISE_FULFILLED,
|
||||
JS_PROMISE_REJECTED,
|
||||
} JSPromiseStateEnum;
|
||||
|
||||
JSValue JS_NewPromiseCapability(JSContext *ctx, JSValue *resolving_funcs);
|
||||
JSPromiseStateEnum JS_PromiseState(JSContext *ctx, JSValue promise);
|
||||
JSValue JS_PromiseResult(JSContext *ctx, JSValue promise);
|
||||
|
||||
/* is_handled = TRUE means that the rejection is handled */
|
||||
typedef void JSHostPromiseRejectionTracker(JSContext *ctx, JSValueConst promise,
|
||||
@@ -902,8 +910,8 @@ int JS_ResolveModule(JSContext *ctx, JSValueConst obj);
|
||||
/* only exported for os.Worker() */
|
||||
JSAtom JS_GetScriptOrModuleName(JSContext *ctx, int n_stack_levels);
|
||||
/* only exported for os.Worker() */
|
||||
JSModuleDef *JS_RunModule(JSContext *ctx, const char *basename,
|
||||
const char *filename);
|
||||
JSValue JS_LoadModule(JSContext *ctx, const char *basename,
|
||||
const char *filename);
|
||||
|
||||
/* C function definition */
|
||||
typedef enum JSCFunctionEnum { /* XXX: should rename for namespace isolation */
|
||||
|
Reference in New Issue
Block a user