@@ -1085,8 +1085,8 @@ static JSValue js_regexp_constructor_internal(JSContext *ctx, JSValue ctor,
1085
1085
static void gc_decref(JSRuntime *rt);
1086
1086
static int JS_NewClass1(JSRuntime *rt, JSClassID class_id,
1087
1087
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);
1090
1090
1091
1091
typedef enum JSStrictEqModeEnum {
1092
1092
JS_EQ_STRICT,
@@ -1180,8 +1180,8 @@ static __exception int perform_promise_then(JSContext *ctx,
1180
1180
JSValue *cap_resolving_funcs);
1181
1181
static JSValue js_promise_resolve(JSContext *ctx, JSValue this_val,
1182
1182
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);
1185
1185
static bool js_string_eq(const JSString *p1, const JSString *p2);
1186
1186
static int js_string_compare(const JSString *p1, const JSString *p2);
1187
1187
static int JS_SetPropertyValue(JSContext *ctx, JSValue this_obj,
@@ -27310,53 +27310,53 @@ static JSValue JS_NewModuleValue(JSContext *ctx, JSModuleDef *m)
27310
27310
return JS_DupValue(ctx, JS_MKPTR(JS_TAG_MODULE, m));
27311
27311
}
27312
27312
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)
27315
27316
{
27316
- JSValueConst *resolving_funcs = (JSValueConst *) func_data;
27317
- JSValueConst error;
27317
+ JSValue *resolving_funcs = func_data;
27318
+ JSValue error;
27318
27319
JSValue ret;
27319
27320
27320
27321
/* XXX: check if the test is necessary */
27321
27322
if (argc >= 1)
27322
27323
error = argv[0];
27323
27324
else
27324
27325
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);
27327
27327
JS_FreeValue(ctx, ret);
27328
27328
return JS_UNDEFINED;
27329
27329
}
27330
27330
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)
27333
27334
{
27334
- JSValueConst *resolving_funcs = (JSValueConst *) func_data;
27335
+ JSValue *resolving_funcs = func_data;
27335
27336
JSModuleDef *m = JS_VALUE_GET_PTR(func_data[2]);
27336
27337
JSValue ret, ns;
27337
27338
27338
27339
/* return the module namespace */
27339
27340
ns = JS_GetModuleNamespace(ctx, m);
27340
27341
if (JS_IsException(ns)) {
27341
27342
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);
27343
27344
return JS_UNDEFINED;
27344
27345
}
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);
27347
27347
JS_FreeValue(ctx, ret);
27348
27348
JS_FreeValue(ctx, ns);
27349
27349
return JS_UNDEFINED;
27350
27350
}
27351
27351
27352
27352
static void JS_LoadModuleInternal(JSContext *ctx, const char *basename,
27353
27353
const char *filename,
27354
- JSValueConst *resolving_funcs)
27354
+ JSValue *resolving_funcs)
27355
27355
{
27356
27356
JSValue evaluate_promise;
27357
27357
JSModuleDef *m;
27358
27358
JSValue ret, err, func_obj, evaluate_resolving_funcs[2];
27359
- JSValueConst func_data[3];
27359
+ JSValue func_data[3];
27360
27360
27361
27361
m = js_host_resolve_imported_module(ctx, basename, filename);
27362
27362
if (!m)
@@ -27373,8 +27373,7 @@ static void JS_LoadModuleInternal(JSContext *ctx, const char *basename,
27373
27373
if (JS_IsException(evaluate_promise)) {
27374
27374
fail:
27375
27375
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);
27378
27377
JS_FreeValue(ctx, ret); /* XXX: what to do if exception ? */
27379
27378
JS_FreeValue(ctx, err);
27380
27379
return;
@@ -27387,7 +27386,7 @@ static void JS_LoadModuleInternal(JSContext *ctx, const char *basename,
27387
27386
evaluate_resolving_funcs[0] = JS_NewCFunctionData(ctx, js_load_module_fulfilled, 0, 0, 3, func_data);
27388
27387
evaluate_resolving_funcs[1] = JS_NewCFunctionData(ctx, js_load_module_rejected, 0, 0, 3, func_data);
27389
27388
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);
27391
27390
JS_FreeValue(ctx, ret);
27392
27391
JS_FreeValue(ctx, evaluate_resolving_funcs[0]);
27393
27392
JS_FreeValue(ctx, evaluate_resolving_funcs[1]);
@@ -27404,8 +27403,7 @@ JSValue JS_LoadModule(JSContext *ctx, const char *basename,
27404
27403
promise = JS_NewPromiseCapability(ctx, resolving_funcs);
27405
27404
if (JS_IsException(promise))
27406
27405
return JS_EXCEPTION;
27407
- JS_LoadModuleInternal(ctx, basename, filename,
27408
- (JSValueConst *)resolving_funcs);
27406
+ JS_LoadModuleInternal(ctx, basename, filename, resolving_funcs);
27409
27407
JS_FreeValue(ctx, resolving_funcs[0]);
27410
27408
JS_FreeValue(ctx, resolving_funcs[1]);
27411
27409
return promise;
@@ -27490,8 +27488,7 @@ static void js_set_module_evaluated(JSContext *ctx, JSModuleDef *m)
27490
27488
JSValue value, ret_val;
27491
27489
assert(m->cycle_root == m);
27492
27490
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);
27495
27492
JS_FreeValue(ctx, ret_val);
27496
27493
}
27497
27494
}
@@ -27558,11 +27555,12 @@ static int js_execute_async_module(JSContext *ctx, JSModuleDef *m);
27558
27555
static int js_execute_sync_module(JSContext *ctx, JSModuleDef *m,
27559
27556
JSValue *pvalue);
27560
27557
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)
27563
27561
{
27564
27562
JSModuleDef *module = JS_VALUE_GET_PTR(func_data[0]);
27565
- JSValueConst error = argv[0];
27563
+ JSValue error = argv[0];
27566
27564
int i;
27567
27565
27568
27566
if (js_check_stack_overflow(ctx->rt, 0))
@@ -27599,8 +27597,9 @@ static JSValue js_async_module_execution_rejected(JSContext *ctx, JSValueConst t
27599
27597
return JS_UNDEFINED;
27600
27598
}
27601
27599
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)
27604
27603
{
27605
27604
JSModuleDef *module = JS_VALUE_GET_PTR(func_data[0]);
27606
27605
ExecModuleList exec_list_s, *exec_list = &exec_list_s;
@@ -27640,8 +27639,7 @@ static JSValue js_async_module_execution_fulfilled(JSContext *ctx, JSValueConst
27640
27639
if (js_execute_sync_module(ctx, m, &error) < 0) {
27641
27640
JSValue m_obj = JS_NewModuleValue(ctx, m);
27642
27641
js_async_module_execution_rejected(ctx, JS_UNDEFINED,
27643
- 1, (JSValueConst *)&error, 0,
27644
- &m_obj);
27642
+ 1, &error, 0, &m_obj);
27645
27643
JS_FreeValue(ctx, m_obj);
27646
27644
JS_FreeValue(ctx, error);
27647
27645
} else {
@@ -27661,9 +27659,9 @@ static int js_execute_async_module(JSContext *ctx, JSModuleDef *m)
27661
27659
if (JS_IsException(promise))
27662
27660
return -1;
27663
27661
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);
27667
27665
JS_FreeValue(ctx, ret_val);
27668
27666
JS_FreeValue(ctx, m_obj);
27669
27667
JS_FreeValue(ctx, resolve_funcs[0]);
@@ -27857,7 +27855,7 @@ static JSValue js_evaluate_module(JSContext *ctx, JSModuleDef *m)
27857
27855
assert(m->status == JS_MODULE_STATUS_EVALUATED);
27858
27856
assert(m->eval_has_exception);
27859
27857
ret_val = JS_Call(ctx, m->resolving_funcs[1], JS_UNDEFINED,
27860
- 1, (JSValueConst *) &m->eval_exception);
27858
+ 1, &m->eval_exception);
27861
27859
JS_FreeValue(ctx, ret_val);
27862
27860
} else {
27863
27861
assert(m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
@@ -27868,7 +27866,7 @@ static JSValue js_evaluate_module(JSContext *ctx, JSModuleDef *m)
27868
27866
assert(m->status == JS_MODULE_STATUS_EVALUATED);
27869
27867
value = JS_UNDEFINED;
27870
27868
ret_val = JS_Call(ctx, m->resolving_funcs[0], JS_UNDEFINED,
27871
- 1, (JSValueConst *) &value);
27869
+ 1, &value);
27872
27870
JS_FreeValue(ctx, ret_val);
27873
27871
}
27874
27872
assert(stack_top == NULL);
0 commit comments