@@ -1085,8 +1085,8 @@ static JSValue js_regexp_constructor_internal(JSContext *ctx, JSValue ctor,
10851085static void gc_decref(JSRuntime *rt);
10861086static int JS_NewClass1(JSRuntime *rt, JSClassID class_id,
10871087 const JSClassDef *class_def, JSAtom name);
1088- static JSValue js_array_push(JSContext *ctx, JSValueConst this_val,
1089- int argc, JSValueConst *argv, int unshift);
1088+ static JSValue js_array_push(JSContext *ctx, JSValue this_val,
1089+ int argc, JSValue *argv, int unshift);
10901090
10911091typedef enum JSStrictEqModeEnum {
10921092 JS_EQ_STRICT,
@@ -1180,8 +1180,8 @@ static __exception int perform_promise_then(JSContext *ctx,
11801180 JSValue *cap_resolving_funcs);
11811181static JSValue js_promise_resolve(JSContext *ctx, JSValue this_val,
11821182 int argc, JSValue *argv, int magic);
1183- static JSValue js_promise_then(JSContext *ctx, JSValueConst this_val,
1184- int argc, JSValueConst *argv);
1183+ static JSValue js_promise_then(JSContext *ctx, JSValue this_val,
1184+ int argc, JSValue *argv);
11851185static bool js_string_eq(const JSString *p1, const JSString *p2);
11861186static int js_string_compare(const JSString *p1, const JSString *p2);
11871187static int JS_SetPropertyValue(JSContext *ctx, JSValue this_obj,
@@ -27310,53 +27310,53 @@ static JSValue JS_NewModuleValue(JSContext *ctx, JSModuleDef *m)
2731027310 return JS_DupValue(ctx, JS_MKPTR(JS_TAG_MODULE, m));
2731127311}
2731227312
27313- static JSValue js_load_module_rejected(JSContext *ctx, JSValueConst this_val,
27314- int argc, JSValueConst *argv, int magic, JSValue *func_data)
27313+ static JSValue js_load_module_rejected(JSContext *ctx, JSValue this_val,
27314+ int argc, JSValue *argv, int magic,
27315+ JSValue *func_data)
2731527316{
27316- JSValueConst *resolving_funcs = (JSValueConst *) func_data;
27317- JSValueConst error;
27317+ JSValue *resolving_funcs = func_data;
27318+ JSValue error;
2731827319 JSValue ret;
2731927320
2732027321 /* XXX: check if the test is necessary */
2732127322 if (argc >= 1)
2732227323 error = argv[0];
2732327324 else
2732427325 error = JS_UNDEFINED;
27325- ret = JS_Call(ctx, resolving_funcs[1], JS_UNDEFINED,
27326- 1, &error);
27326+ ret = JS_Call(ctx, resolving_funcs[1], JS_UNDEFINED, 1, &error);
2732727327 JS_FreeValue(ctx, ret);
2732827328 return JS_UNDEFINED;
2732927329}
2733027330
27331- static JSValue js_load_module_fulfilled(JSContext *ctx, JSValueConst this_val,
27332- int argc, JSValueConst *argv, int magic, JSValue *func_data)
27331+ static JSValue js_load_module_fulfilled(JSContext *ctx, JSValue this_val,
27332+ int argc, JSValue *argv, int magic,
27333+ JSValue *func_data)
2733327334{
27334- JSValueConst *resolving_funcs = (JSValueConst *) func_data;
27335+ JSValue *resolving_funcs = func_data;
2733527336 JSModuleDef *m = JS_VALUE_GET_PTR(func_data[2]);
2733627337 JSValue ret, ns;
2733727338
2733827339 /* return the module namespace */
2733927340 ns = JS_GetModuleNamespace(ctx, m);
2734027341 if (JS_IsException(ns)) {
2734127342 JSValue err = JS_GetException(ctx);
27342- js_load_module_rejected(ctx, JS_UNDEFINED, 1, (JSValueConst *) &err, 0, func_data);
27343+ js_load_module_rejected(ctx, JS_UNDEFINED, 1, &err, 0, func_data);
2734327344 return JS_UNDEFINED;
2734427345 }
27345- ret = JS_Call(ctx, resolving_funcs[0], JS_UNDEFINED,
27346- 1, (JSValueConst *)&ns);
27346+ ret = JS_Call(ctx, resolving_funcs[0], JS_UNDEFINED, 1, &ns);
2734727347 JS_FreeValue(ctx, ret);
2734827348 JS_FreeValue(ctx, ns);
2734927349 return JS_UNDEFINED;
2735027350}
2735127351
2735227352static void JS_LoadModuleInternal(JSContext *ctx, const char *basename,
2735327353 const char *filename,
27354- JSValueConst *resolving_funcs)
27354+ JSValue *resolving_funcs)
2735527355{
2735627356 JSValue evaluate_promise;
2735727357 JSModuleDef *m;
2735827358 JSValue ret, err, func_obj, evaluate_resolving_funcs[2];
27359- JSValueConst func_data[3];
27359+ JSValue func_data[3];
2736027360
2736127361 m = js_host_resolve_imported_module(ctx, basename, filename);
2736227362 if (!m)
@@ -27373,8 +27373,7 @@ static void JS_LoadModuleInternal(JSContext *ctx, const char *basename,
2737327373 if (JS_IsException(evaluate_promise)) {
2737427374 fail:
2737527375 err = JS_GetException(ctx);
27376- ret = JS_Call(ctx, resolving_funcs[1], JS_UNDEFINED,
27377- 1, (JSValueConst *)&err);
27376+ ret = JS_Call(ctx, resolving_funcs[1], JS_UNDEFINED, 1, &err);
2737827377 JS_FreeValue(ctx, ret); /* XXX: what to do if exception ? */
2737927378 JS_FreeValue(ctx, err);
2738027379 return;
@@ -27387,7 +27386,7 @@ static void JS_LoadModuleInternal(JSContext *ctx, const char *basename,
2738727386 evaluate_resolving_funcs[0] = JS_NewCFunctionData(ctx, js_load_module_fulfilled, 0, 0, 3, func_data);
2738827387 evaluate_resolving_funcs[1] = JS_NewCFunctionData(ctx, js_load_module_rejected, 0, 0, 3, func_data);
2738927388 JS_FreeValue(ctx, func_obj);
27390- ret = js_promise_then(ctx, evaluate_promise, 2, (JSValueConst *) evaluate_resolving_funcs);
27389+ ret = js_promise_then(ctx, evaluate_promise, 2, evaluate_resolving_funcs);
2739127390 JS_FreeValue(ctx, ret);
2739227391 JS_FreeValue(ctx, evaluate_resolving_funcs[0]);
2739327392 JS_FreeValue(ctx, evaluate_resolving_funcs[1]);
@@ -27404,8 +27403,7 @@ JSValue JS_LoadModule(JSContext *ctx, const char *basename,
2740427403 promise = JS_NewPromiseCapability(ctx, resolving_funcs);
2740527404 if (JS_IsException(promise))
2740627405 return JS_EXCEPTION;
27407- JS_LoadModuleInternal(ctx, basename, filename,
27408- (JSValueConst *)resolving_funcs);
27406+ JS_LoadModuleInternal(ctx, basename, filename, resolving_funcs);
2740927407 JS_FreeValue(ctx, resolving_funcs[0]);
2741027408 JS_FreeValue(ctx, resolving_funcs[1]);
2741127409 return promise;
@@ -27490,8 +27488,7 @@ static void js_set_module_evaluated(JSContext *ctx, JSModuleDef *m)
2749027488 JSValue value, ret_val;
2749127489 assert(m->cycle_root == m);
2749227490 value = JS_UNDEFINED;
27493- ret_val = JS_Call(ctx, m->resolving_funcs[0], JS_UNDEFINED,
27494- 1, (JSValueConst *)&value);
27491+ ret_val = JS_Call(ctx, m->resolving_funcs[0], JS_UNDEFINED, 1, &value);
2749527492 JS_FreeValue(ctx, ret_val);
2749627493 }
2749727494}
@@ -27558,11 +27555,12 @@ static int js_execute_async_module(JSContext *ctx, JSModuleDef *m);
2755827555static int js_execute_sync_module(JSContext *ctx, JSModuleDef *m,
2755927556 JSValue *pvalue);
2756027557
27561- static JSValue js_async_module_execution_rejected(JSContext *ctx, JSValueConst this_val,
27562- int argc, JSValueConst *argv, int magic, JSValue *func_data)
27558+ static JSValue js_async_module_execution_rejected(JSContext *ctx, JSValue this_val,
27559+ int argc, JSValue *argv, int magic,
27560+ JSValue *func_data)
2756327561{
2756427562 JSModuleDef *module = JS_VALUE_GET_PTR(func_data[0]);
27565- JSValueConst error = argv[0];
27563+ JSValue error = argv[0];
2756627564 int i;
2756727565
2756827566 if (js_check_stack_overflow(ctx->rt, 0))
@@ -27599,8 +27597,9 @@ static JSValue js_async_module_execution_rejected(JSContext *ctx, JSValueConst t
2759927597 return JS_UNDEFINED;
2760027598}
2760127599
27602- static JSValue js_async_module_execution_fulfilled(JSContext *ctx, JSValueConst this_val,
27603- int argc, JSValueConst *argv, int magic, JSValue *func_data)
27600+ static JSValue js_async_module_execution_fulfilled(JSContext *ctx, JSValue this_val,
27601+ int argc, JSValue *argv, int magic,
27602+ JSValue *func_data)
2760427603{
2760527604 JSModuleDef *module = JS_VALUE_GET_PTR(func_data[0]);
2760627605 ExecModuleList exec_list_s, *exec_list = &exec_list_s;
@@ -27640,8 +27639,7 @@ static JSValue js_async_module_execution_fulfilled(JSContext *ctx, JSValueConst
2764027639 if (js_execute_sync_module(ctx, m, &error) < 0) {
2764127640 JSValue m_obj = JS_NewModuleValue(ctx, m);
2764227641 js_async_module_execution_rejected(ctx, JS_UNDEFINED,
27643- 1, (JSValueConst *)&error, 0,
27644- &m_obj);
27642+ 1, &error, 0, &m_obj);
2764527643 JS_FreeValue(ctx, m_obj);
2764627644 JS_FreeValue(ctx, error);
2764727645 } else {
@@ -27661,9 +27659,9 @@ static int js_execute_async_module(JSContext *ctx, JSModuleDef *m)
2766127659 if (JS_IsException(promise))
2766227660 return -1;
2766327661 m_obj = JS_NewModuleValue(ctx, m);
27664- resolve_funcs[0] = JS_NewCFunctionData(ctx, js_async_module_execution_fulfilled, 0, 0, 1, (JSValueConst *) &m_obj);
27665- resolve_funcs[1] = JS_NewCFunctionData(ctx, js_async_module_execution_rejected, 0, 0, 1, (JSValueConst *) &m_obj);
27666- ret_val = js_promise_then(ctx, promise, 2, (JSValueConst *) resolve_funcs);
27662+ resolve_funcs[0] = JS_NewCFunctionData(ctx, js_async_module_execution_fulfilled, 0, 0, 1, &m_obj);
27663+ resolve_funcs[1] = JS_NewCFunctionData(ctx, js_async_module_execution_rejected, 0, 0, 1, &m_obj);
27664+ ret_val = js_promise_then(ctx, promise, 2, resolve_funcs);
2766727665 JS_FreeValue(ctx, ret_val);
2766827666 JS_FreeValue(ctx, m_obj);
2766927667 JS_FreeValue(ctx, resolve_funcs[0]);
@@ -27857,7 +27855,7 @@ static JSValue js_evaluate_module(JSContext *ctx, JSModuleDef *m)
2785727855 assert(m->status == JS_MODULE_STATUS_EVALUATED);
2785827856 assert(m->eval_has_exception);
2785927857 ret_val = JS_Call(ctx, m->resolving_funcs[1], JS_UNDEFINED,
27860- 1, (JSValueConst *) &m->eval_exception);
27858+ 1, &m->eval_exception);
2786127859 JS_FreeValue(ctx, ret_val);
2786227860 } else {
2786327861 assert(m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
@@ -27868,7 +27866,7 @@ static JSValue js_evaluate_module(JSContext *ctx, JSModuleDef *m)
2786827866 assert(m->status == JS_MODULE_STATUS_EVALUATED);
2786927867 value = JS_UNDEFINED;
2787027868 ret_val = JS_Call(ctx, m->resolving_funcs[0], JS_UNDEFINED,
27871- 1, (JSValueConst *) &value);
27869+ 1, &value);
2787227870 JS_FreeValue(ctx, ret_val);
2787327871 }
2787427872 assert(stack_top == NULL);
0 commit comments