diff --git a/include/modules/collections.h b/include/modules/collections.h index d7166e5..01442c6 100644 --- a/include/modules/collections.h +++ b/include/modules/collections.h @@ -53,8 +53,8 @@ typedef struct set_iterator_state { void init_collections_module(void); -map_entry_t **get_map_from_obj(ant_t *js, ant_value_t obj); -set_entry_t **get_set_from_obj(ant_t *js, ant_value_t obj); +map_entry_t **get_map_from_obj(ant_value_t obj); +set_entry_t **get_set_from_obj(ant_value_t obj); extern ant_value_t g_map_iter_proto; extern ant_value_t g_set_iter_proto; diff --git a/src/modules/async_hooks.c b/src/modules/async_hooks.c index fadb14b..7010684 100644 --- a/src/modules/async_hooks.c +++ b/src/modules/async_hooks.c @@ -26,7 +26,7 @@ static ant_value_t async_hooks_call_with_tail_args( return result; } -static ant_value_t async_local_storage_run(ant_t *js, ant_value_t *args, int nargs) { +static ant_value_t async_local_storage_run(ant_params_t) { if (nargs < 2 || !is_callable(args[1])) { return js_mkerr(js, "AsyncLocalStorage.run(store, callback, ...args) requires a callback"); } @@ -43,7 +43,7 @@ static ant_value_t async_local_storage_run(ant_t *js, ant_value_t *args, int nar return result; } -static ant_value_t async_local_storage_exit(ant_t *js, ant_value_t *args, int nargs) { +static ant_value_t async_local_storage_exit(ant_params_t) { if (nargs < 1 || !is_callable(args[0])) { return js_mkerr(js, "AsyncLocalStorage.exit(callback, ...args) requires a callback"); } @@ -60,7 +60,7 @@ static ant_value_t async_local_storage_exit(ant_t *js, ant_value_t *args, int na return result; } -static ant_value_t async_local_storage_enterWith(ant_t *js, ant_value_t *args, int nargs) { +static ant_value_t async_local_storage_enterWith(ant_params_t) { ant_value_t this_obj = js_getthis(js); if (!is_object_type(this_obj)) { return js_mkerr(js, "AsyncLocalStorage.enterWith() requires an AsyncLocalStorage instance"); @@ -69,21 +69,19 @@ static ant_value_t async_local_storage_enterWith(ant_t *js, ant_value_t *args, i return js_mkundef(); } -static ant_value_t async_local_storage_getStore(ant_t *js, ant_value_t *args, int nargs) { - (void)args; (void)nargs; +static ant_value_t async_local_storage_getStore(ant_params_t) { ant_value_t this_obj = js_getthis(js); if (!is_object_type(this_obj)) return js_mkundef(); return js_get_slot(this_obj, SLOT_DATA); } -static ant_value_t async_local_storage_disable(ant_t *js, ant_value_t *args, int nargs) { - (void)args; (void)nargs; +static ant_value_t async_local_storage_disable(ant_params_t) { ant_value_t this_obj = js_getthis(js); if (is_object_type(this_obj)) js_set_slot_wb(js, this_obj, SLOT_DATA, js_mkundef()); return js_mkundef(); } -static ant_value_t async_resource_runInAsyncScope(ant_t *js, ant_value_t *args, int nargs) { +static ant_value_t async_resource_runInAsyncScope(ant_params_t) { if (nargs < 1 || !is_callable(args[0])) { return js_mkerr(js, "AsyncResource.runInAsyncScope(fn[, thisArg, ...args]) requires a function"); } @@ -91,51 +89,42 @@ static ant_value_t async_resource_runInAsyncScope(ant_t *js, ant_value_t *args, return async_hooks_call_with_tail_args(js, args[0], this_arg, args, nargs, 2); } -static ant_value_t async_resource_emitDestroy(ant_t *js, ant_value_t *args, int nargs) { - (void)args; (void)nargs; +static ant_value_t async_resource_emitDestroy(ant_params_t) { return js_getthis(js); } -static ant_value_t async_resource_asyncId(ant_t *js, ant_value_t *args, int nargs) { - (void)js; (void)args; (void)nargs; +static ant_value_t async_resource_asyncId(ant_params_t) { return js_mknum(0); } -static ant_value_t async_resource_triggerAsyncId(ant_t *js, ant_value_t *args, int nargs) { - (void)js; (void)args; (void)nargs; +static ant_value_t async_resource_triggerAsyncId(ant_params_t) { return js_mknum(0); } -static ant_value_t async_hook_enable(ant_t *js, ant_value_t *args, int nargs) { - (void)args; (void)nargs; +static ant_value_t async_hook_enable(ant_params_t) { return js_getthis(js); } -static ant_value_t async_hook_disable(ant_t *js, ant_value_t *args, int nargs) { - (void)args; (void)nargs; +static ant_value_t async_hook_disable(ant_params_t) { return js_getthis(js); } -static ant_value_t async_hooks_createHook(ant_t *js, ant_value_t *args, int nargs) { - (void)args; (void)nargs; +static ant_value_t async_hooks_createHook(ant_params_t) { ant_value_t hook = js_mkobj(js); js_set(js, hook, "enable", js_mkfun(async_hook_enable)); js_set(js, hook, "disable", js_mkfun(async_hook_disable)); return hook; } -static ant_value_t async_hooks_executionAsyncId(ant_t *js, ant_value_t *args, int nargs) { - (void)js; (void)args; (void)nargs; +static ant_value_t async_hooks_executionAsyncId(ant_params_t) { return js_mknum(1); } -static ant_value_t async_hooks_triggerAsyncId(ant_t *js, ant_value_t *args, int nargs) { - (void)js; (void)args; (void)nargs; +static ant_value_t async_hooks_triggerAsyncId(ant_params_t) { return js_mknum(0); } -static ant_value_t async_hooks_executionAsyncResource(ant_t *js, ant_value_t *args, int nargs) { - (void)args; (void)nargs; +static ant_value_t async_hooks_executionAsyncResource(ant_params_t) { return js_mkobj(js); } diff --git a/src/modules/bigint.c b/src/modules/bigint.c index 5d1b079..9c97d2a 100644 --- a/src/modules/bigint.c +++ b/src/modules/bigint.c @@ -71,8 +71,7 @@ static void bigint_normalize_limbs(uint32_t *limbs, size_t *count) { while (*count > 1 && limbs[*count - 1] == 0) (*count)--; } -static inline const bigint_payload_t *bigint_payload(ant_t *js, ant_value_t v) { - (void)js; +static inline const bigint_payload_t *bigint_payload(ant_value_t v) { return (const bigint_payload_t *)(uintptr_t)vdata(v); } @@ -81,11 +80,11 @@ static inline bool limbs_is_zero(const uint32_t *limbs, size_t count) { } bool bigint_is_negative(ant_t *js, ant_value_t v) { - return bigint_payload(js, v)->sign == 1; + return bigint_payload(v)->sign == 1; } static const uint32_t *bigint_limbs(ant_t *js, ant_value_t v, size_t *count) { - const bigint_payload_t *payload = bigint_payload(js, v); + const bigint_payload_t *payload = bigint_payload(v); size_t limb_count = payload->limb_count; if (limb_count == 0) limb_count = 1; if (count) *count = limb_count; diff --git a/src/modules/buffer.c b/src/modules/buffer.c index ec4d8e5..02a9345 100644 --- a/src/modules/buffer.c +++ b/src/modules/buffer.c @@ -717,7 +717,6 @@ typedef struct { } iter_collect_ctx_t; static bool iter_collect_callback(ant_t *js, ant_value_t value, void *udata) { - (void)js; iter_collect_ctx_t *ctx = (iter_collect_ctx_t *)udata; if (ctx->length >= ctx->capacity) { ctx->capacity *= 2; diff --git a/src/modules/builtin.c b/src/modules/builtin.c index 5ed912f..898c17b 100644 --- a/src/modules/builtin.c +++ b/src/modules/builtin.c @@ -79,7 +79,6 @@ static ant_value_t js_raw_ctor_prop_feedback(ant_t *js, ant_value_t *args, int n if (vtype(args[0]) != T_FUNC) return js_mkerr(js, "constructor must be a function"); #ifndef ANT_JIT - (void)js; return js_mkerr(js, "constructor property feedback requires ANT_JIT"); #else ant_value_t ctor = args[0]; diff --git a/src/modules/collections.c b/src/modules/collections.c index 532e630..9116cf5 100644 --- a/src/modules/collections.c +++ b/src/modules/collections.c @@ -305,41 +305,37 @@ static ant_value_t weakset_init_from_iterable(ant_t *js, weakset_entry_t **ws_he return js_mkundef(); } -map_entry_t **get_map_from_obj(ant_t *js, ant_value_t obj) { - (void)js; +map_entry_t **get_map_from_obj(ant_value_t obj) { ant_object_t *ptr = js_obj_ptr(obj); if (!ptr || ptr->type_tag != T_MAP) return NULL; return (map_entry_t **)(uintptr_t)js_getnum(ptr->u.data.value); } -set_entry_t **get_set_from_obj(ant_t *js, ant_value_t obj) { - (void)js; +set_entry_t **get_set_from_obj(ant_value_t obj) { ant_object_t *ptr = js_obj_ptr(obj); if (!ptr || ptr->type_tag != T_SET) return NULL; return (set_entry_t **)(uintptr_t)js_getnum(ptr->u.data.value); } -static weakmap_entry_t **get_weakmap_from_obj(ant_t *js, ant_value_t obj) { - (void)js; +static weakmap_entry_t **get_weakmap_from_obj(ant_value_t obj) { ant_object_t *ptr = js_obj_ptr(obj); if (!ptr || ptr->type_tag != T_WEAKMAP) return NULL; return (weakmap_entry_t **)(uintptr_t)js_getnum(ptr->u.data.value); } -static weakset_entry_t **get_weakset_from_obj(ant_t *js, ant_value_t obj) { - (void)js; +static weakset_entry_t **get_weakset_from_obj(ant_value_t obj) { ant_object_t *ptr = js_obj_ptr(obj); if (!ptr || ptr->type_tag != T_WEAKSET) return NULL; return (weakset_entry_t **)(uintptr_t)js_getnum(ptr->u.data.value); } -static map_iterator_state_t *get_map_iter_state(ant_t *js, ant_value_t obj) { +static map_iterator_state_t *get_map_iter_state(ant_value_t obj) { ant_value_t state_val = js_get_slot(obj, SLOT_ITER_STATE); if (vtype(state_val) == T_UNDEF) return NULL; return (map_iterator_state_t *)(uintptr_t)js_getnum(state_val); } -static set_iterator_state_t *get_set_iter_state(ant_t *js, ant_value_t obj) { +static set_iterator_state_t *get_set_iter_state(ant_value_t obj) { ant_value_t state_val = js_get_slot(obj, SLOT_ITER_STATE); if (vtype(state_val) == T_UNDEF) return NULL; return (set_iterator_state_t *)(uintptr_t)js_getnum(state_val); @@ -349,7 +345,7 @@ static ant_value_t map_set(ant_t *js, ant_value_t *args, int nargs) { if (nargs < 2) return js_mkerr(js, "Map.set() requires 2 arguments"); ant_value_t this_val = js->this_val; - map_entry_t **map_ptr = get_map_from_obj(js, this_val); + map_entry_t **map_ptr = get_map_from_obj(this_val); if (!map_ptr) return js_mkerr(js, "Invalid Map object"); ant_value_t key_val = normalize_map_key(args[0]); @@ -369,7 +365,7 @@ static ant_value_t map_get(ant_t *js, ant_value_t *args, int nargs) { if (nargs < 1) return js_mkerr(js, "Map.get() requires 1 argument"); ant_value_t this_val = js->this_val; - map_entry_t **map_ptr = get_map_from_obj(js, this_val); + map_entry_t **map_ptr = get_map_from_obj(this_val); if (!map_ptr) return js_mkundef(); map_entry_t *entry = map_find_entry(js, map_ptr, args[0]); @@ -380,7 +376,7 @@ static ant_value_t map_has(ant_t *js, ant_value_t *args, int nargs) { if (nargs < 1) return js_mkerr(js, "Map.has() requires 1 argument"); ant_value_t this_val = js->this_val; - map_entry_t **map_ptr = get_map_from_obj(js, this_val); + map_entry_t **map_ptr = get_map_from_obj(this_val); if (!map_ptr) return js_false; map_entry_t *entry = map_find_entry(js, map_ptr, args[0]); @@ -391,7 +387,7 @@ static ant_value_t map_delete(ant_t *js, ant_value_t *args, int nargs) { if (nargs < 1) return js_mkerr(js, "Map.delete() requires 1 argument"); ant_value_t this_val = js->this_val; - map_entry_t **map_ptr = get_map_from_obj(js, this_val); + map_entry_t **map_ptr = get_map_from_obj(this_val); if (!map_ptr) return js_false; map_entry_t *entry = map_find_entry(js, map_ptr, args[0]); @@ -406,7 +402,7 @@ static ant_value_t map_delete(ant_t *js, ant_value_t *args, int nargs) { static ant_value_t map_clear(ant_t *js, ant_value_t *args, int nargs) { ant_value_t this_val = js->this_val; - map_entry_t **map_ptr = get_map_from_obj(js, this_val); + map_entry_t **map_ptr = get_map_from_obj(this_val); if (!map_ptr) return js_mkundef(); map_entry_t *entry, *tmp; @@ -422,7 +418,7 @@ static ant_value_t map_clear(ant_t *js, ant_value_t *args, int nargs) { static ant_value_t map_size(ant_t *js, ant_value_t *args, int nargs) { ant_value_t this_val = js->this_val; - map_entry_t **map_ptr = get_map_from_obj(js, this_val); + map_entry_t **map_ptr = get_map_from_obj(this_val); if (!map_ptr) return js_mknum(0); return js_mknum((double)HASH_COUNT(*map_ptr)); @@ -430,7 +426,7 @@ static ant_value_t map_size(ant_t *js, ant_value_t *args, int nargs) { static ant_value_t map_forEach(ant_t *js, ant_value_t *args, int nargs) { ant_value_t this_val = js->this_val; - map_entry_t **map_ptr = get_map_from_obj(js, this_val); + map_entry_t **map_ptr = get_map_from_obj(this_val); if (nargs < 1 || vtype(args[0]) != T_FUNC) return js_mkerr(js, "forEach requires a callback function"); @@ -450,7 +446,7 @@ static ant_value_t map_forEach(ant_t *js, ant_value_t *args, int nargs) { } bool advance_map(ant_t *js, js_iter_t *it, ant_value_t *out) { - map_iterator_state_t *state = get_map_iter_state(js, it->iterator); + map_iterator_state_t *state = get_map_iter_state(it->iterator); if (!state || !state->current) return false; map_entry_t *entry = state->current; @@ -482,7 +478,7 @@ static ant_value_t map_iter_next(ant_t *js, ant_value_t *args, int nargs) { } static ant_value_t create_map_iterator(ant_t *js, ant_value_t map_obj, iter_type_t type) { - map_entry_t **map_ptr = get_map_from_obj(js, map_obj); + map_entry_t **map_ptr = get_map_from_obj(map_obj); map_iterator_state_t *state = ant_calloc(sizeof(map_iterator_state_t)); if (!state) return js_mkerr(js, "out of memory"); @@ -514,7 +510,7 @@ static ant_value_t map_entries(ant_t *js, ant_value_t *args, int nargs) { } bool advance_set(ant_t *js, js_iter_t *it, ant_value_t *out) { - set_iterator_state_t *state = get_set_iter_state(js, it->iterator); + set_iterator_state_t *state = get_set_iter_state(it->iterator); if (!state || !state->current) return false; set_entry_t *entry = state->current; @@ -536,7 +532,7 @@ static ant_value_t set_iter_next(ant_t *js, ant_value_t *args, int nargs) { } static ant_value_t create_set_iterator(ant_t *js, ant_value_t set_obj, iter_type_t type) { - set_entry_t **set_ptr = get_set_from_obj(js, set_obj); + set_entry_t **set_ptr = get_set_from_obj(set_obj); set_iterator_state_t *state = ant_calloc(sizeof(set_iterator_state_t)); if (!state) return js_mkerr(js, "out of memory"); @@ -556,7 +552,7 @@ static ant_value_t set_add(ant_t *js, ant_value_t *args, int nargs) { if (nargs < 1) return js_mkerr(js, "Set.add() requires 1 argument"); ant_value_t this_val = js->this_val; - set_entry_t **set_ptr = get_set_from_obj(js, this_val); + set_entry_t **set_ptr = get_set_from_obj(this_val); if (!set_ptr) return js_mkerr(js, "Invalid Set object"); if (!set_store_entry(js, set_ptr, args[0])) @@ -572,7 +568,7 @@ static ant_value_t set_has(ant_t *js, ant_value_t *args, int nargs) { if (nargs < 1) return js_mkerr(js, "Set.has() requires 1 argument"); ant_value_t this_val = js->this_val; - set_entry_t **set_ptr = get_set_from_obj(js, this_val); + set_entry_t **set_ptr = get_set_from_obj(this_val); if (!set_ptr) return js_false; set_entry_t *entry = set_find_entry(js, set_ptr, args[0]); @@ -583,7 +579,7 @@ static ant_value_t set_delete(ant_t *js, ant_value_t *args, int nargs) { if (nargs < 1) return js_mkerr(js, "Set.delete() requires 1 argument"); ant_value_t this_val = js->this_val; - set_entry_t **set_ptr = get_set_from_obj(js, this_val); + set_entry_t **set_ptr = get_set_from_obj(this_val); if (!set_ptr) return js_false; set_entry_t *entry = set_find_entry(js, set_ptr, args[0]); @@ -600,7 +596,7 @@ static ant_value_t set_delete(ant_t *js, ant_value_t *args, int nargs) { static ant_value_t set_clear(ant_t *js, ant_value_t *args, int nargs) { (void)args; (void)nargs; ant_value_t this_val = js->this_val; - set_entry_t **set_ptr = get_set_from_obj(js, this_val); + set_entry_t **set_ptr = get_set_from_obj(this_val); if (!set_ptr) return js_mkundef(); set_entry_t *entry, *tmp; @@ -617,7 +613,7 @@ static ant_value_t set_clear(ant_t *js, ant_value_t *args, int nargs) { static ant_value_t set_size(ant_t *js, ant_value_t *args, int nargs) { (void)args; (void)nargs; ant_value_t this_val = js->this_val; - set_entry_t **set_ptr = get_set_from_obj(js, this_val); + set_entry_t **set_ptr = get_set_from_obj(this_val); if (!set_ptr) return js_mknum(0); return js_mknum((double)HASH_COUNT(*set_ptr)); @@ -635,7 +631,7 @@ static ant_value_t set_entries(ant_t *js, ant_value_t *args, int nargs) { static ant_value_t set_forEach(ant_t *js, ant_value_t *args, int nargs) { ant_value_t this_val = js->this_val; - set_entry_t **set_ptr = get_set_from_obj(js, this_val); + set_entry_t **set_ptr = get_set_from_obj(this_val); if (nargs < 1 || vtype(args[0]) != T_FUNC) return js_mkerr(js, "forEach requires a callback function"); @@ -658,7 +654,7 @@ static ant_value_t weakmap_set(ant_t *js, ant_value_t *args, int nargs) { if (nargs < 2) return js_mkerr(js, "WeakMap.set() requires 2 arguments"); ant_value_t this_val = js->this_val; - weakmap_entry_t **wm_ptr = get_weakmap_from_obj(js, this_val); + weakmap_entry_t **wm_ptr = get_weakmap_from_obj(this_val); if (!wm_ptr) return js_mkerr(js, "Invalid WeakMap object"); if (!is_object_type(args[0])) @@ -691,7 +687,7 @@ static ant_value_t weakmap_get(ant_t *js, ant_value_t *args, int nargs) { if (nargs < 1) return js_mkerr(js, "WeakMap.get() requires 1 argument"); ant_value_t this_val = js->this_val; - weakmap_entry_t **wm_ptr = get_weakmap_from_obj(js, this_val); + weakmap_entry_t **wm_ptr = get_weakmap_from_obj(this_val); if (!wm_ptr) return js_mkundef(); if (!is_object_type(args[0])) return js_mkundef(); @@ -705,7 +701,7 @@ static ant_value_t weakmap_has(ant_t *js, ant_value_t *args, int nargs) { if (nargs < 1) return js_mkerr(js, "WeakMap.has() requires 1 argument"); ant_value_t this_val = js->this_val; - weakmap_entry_t **wm_ptr = get_weakmap_from_obj(js, this_val); + weakmap_entry_t **wm_ptr = get_weakmap_from_obj(this_val); if (!wm_ptr) return js_false; if (!is_object_type(args[0])) return js_false; @@ -719,7 +715,7 @@ static ant_value_t weakmap_delete(ant_t *js, ant_value_t *args, int nargs) { if (nargs < 1) return js_mkerr(js, "WeakMap.delete() requires 1 argument"); ant_value_t this_val = js->this_val; - weakmap_entry_t **wm_ptr = get_weakmap_from_obj(js, this_val); + weakmap_entry_t **wm_ptr = get_weakmap_from_obj(this_val); if (!wm_ptr) return js_false; if (!is_object_type(args[0])) return js_false; @@ -738,7 +734,7 @@ static ant_value_t weakset_add(ant_t *js, ant_value_t *args, int nargs) { if (nargs < 1) return js_mkerr(js, "WeakSet.add() requires 1 argument"); ant_value_t this_val = js->this_val; - weakset_entry_t **ws_ptr = get_weakset_from_obj(js, this_val); + weakset_entry_t **ws_ptr = get_weakset_from_obj(this_val); if (!ws_ptr) return js_mkerr(js, "Invalid WeakSet object"); if (!is_object_type(args[0])) @@ -763,7 +759,7 @@ static ant_value_t weakset_has(ant_t *js, ant_value_t *args, int nargs) { if (nargs < 1) return js_mkerr(js, "WeakSet.has() requires 1 argument"); ant_value_t this_val = js->this_val; - weakset_entry_t **ws_ptr = get_weakset_from_obj(js, this_val); + weakset_entry_t **ws_ptr = get_weakset_from_obj(this_val); if (!ws_ptr) return js_false; if (!is_object_type(args[0])) return js_false; @@ -777,7 +773,7 @@ static ant_value_t weakset_delete(ant_t *js, ant_value_t *args, int nargs) { if (nargs < 1) return js_mkerr(js, "WeakSet.delete() requires 1 argument"); ant_value_t this_val = js->this_val; - weakset_entry_t **ws_ptr = get_weakset_from_obj(js, this_val); + weakset_entry_t **ws_ptr = get_weakset_from_obj(this_val); if (!ws_ptr) return js_false; if (!is_object_type(args[0])) return js_false; diff --git a/src/modules/ffi.c b/src/modules/ffi.c index c072061..a3e23d0 100644 --- a/src/modules/ffi.c +++ b/src/modules/ffi.c @@ -784,7 +784,6 @@ static ant_value_t ffi_make_function(ant_t *js, ffi_library_handle_t *library, c void ffi_library_finalize(ant_t *js, ant_object_t *obj) { ffi_library_handle_t *library; - (void)js; if (obj->native.tag != FFI_LIBRARY_NATIVE_TAG) return; library = (ffi_library_handle_t *)obj->native.ptr; @@ -799,7 +798,6 @@ void ffi_library_finalize(ant_t *js, ant_object_t *obj) { void ffi_function_finalize(ant_t *js, ant_object_t *obj) { ffi_function_handle_t *handle; - (void)js; if (obj->native.tag != FFI_FUNCTION_NATIVE_TAG) return; handle = (ffi_function_handle_t *)obj->native.ptr; @@ -814,7 +812,6 @@ void ffi_function_finalize(ant_t *js, ant_object_t *obj) { void ffi_pointer_finalize(ant_t *js, ant_object_t *obj) { ffi_pointer_handle_t *handle; - (void)js; if (obj->native.tag != FFI_POINTER_NATIVE_TAG) return; handle = (ffi_pointer_handle_t *)obj->native.ptr; @@ -828,7 +825,6 @@ void ffi_pointer_finalize(ant_t *js, ant_object_t *obj) { void ffi_callback_finalize(ant_t *js, ant_object_t *obj) { ffi_callback_handle_t *handle; - (void)js; if (obj->native.tag != FFI_CALLBACK_NATIVE_TAG) return; handle = (ffi_callback_handle_t *)obj->native.ptr; diff --git a/src/modules/process.c b/src/modules/process.c index 20b4229..a99ee85 100644 --- a/src/modules/process.c +++ b/src/modules/process.c @@ -1112,8 +1112,7 @@ static ant_value_t process_kill(ant_t *js, ant_value_t *args, int nargs) { return js_true; } -static ant_value_t process_abort(ant_t *js, ant_value_t *args, int nargs) { - (void)js; (void)args; (void)nargs; +static ant_value_t process_abort(ant_params_t) { abort(); return js_mkundef(); } diff --git a/src/modules/reflect.c b/src/modules/reflect.c index df2b2a7..00b8b89 100644 --- a/src/modules/reflect.c +++ b/src/modules/reflect.c @@ -288,7 +288,6 @@ static ant_value_t reflect_set_prototype_of(ant_t *js, ant_value_t *args, int na } static ant_value_t reflect_is_extensible(ant_t *js, ant_value_t *args, int nargs) { - (void)js; if (nargs < 1) return js_false; ant_value_t target = args[0]; @@ -303,7 +302,6 @@ static ant_value_t reflect_is_extensible(ant_t *js, ant_value_t *args, int nargs } static ant_value_t reflect_prevent_extensions(ant_t *js, ant_value_t *args, int nargs) { - (void)js; if (nargs < 1) return js_false; ant_value_t target = args[0]; diff --git a/src/modules/sessionstorage.c b/src/modules/sessionstorage.c index ad00220..384e4be 100644 --- a/src/modules/sessionstorage.c +++ b/src/modules/sessionstorage.c @@ -127,8 +127,7 @@ static ant_value_t js_sessionstorage_removeItem(ant_t *js, ant_value_t *args, in } // sessionStorage.clear() -static ant_value_t js_sessionstorage_clear(ant_t *js, ant_value_t *args, int nargs) { - (void)js; (void)args; (void)nargs; +static ant_value_t js_sessionstorage_clear(ant_params_t) { storage_clear(); return js_mkundef(); } @@ -155,8 +154,7 @@ static ant_value_t js_sessionstorage_key(ant_t *js, ant_value_t *args, int nargs } // sessionStorage.length -static ant_value_t js_sessionstorage_length(ant_t *js, ant_value_t *args, int nargs) { - (void)js; (void)args; (void)nargs; +static ant_value_t js_sessionstorage_length(ant_params_t) { return js_mknum((double)storage_length()); } diff --git a/src/modules/structured-clone.c b/src/modules/structured-clone.c index 5178a75..e26dbdd 100644 --- a/src/modules/structured-clone.c +++ b/src/modules/structured-clone.c @@ -193,7 +193,7 @@ static ant_value_t sc_clone_rec(ant_t *js, ant_value_t val, sc_entry_t **seen, s js_set_slot(clone, SLOT_DATA, ANT_PTR(new_head)); sc_add(seen, val, clone); - map_entry_t **src_head = get_map_from_obj(js, val); + map_entry_t **src_head = get_map_from_obj(val); if (src_head && *src_head) { map_entry_t *e, *tmp; HASH_ITER(hh, *src_head, e, tmp) { @@ -229,7 +229,7 @@ static ant_value_t sc_clone_rec(ant_t *js, ant_value_t val, sc_entry_t **seen, s js_set_slot(clone, SLOT_DATA, ANT_PTR(new_head)); sc_add(seen, val, clone); - set_entry_t **src_head = get_set_from_obj(js, val); + set_entry_t **src_head = get_set_from_obj(val); if (src_head && *src_head) { set_entry_t *e, *tmp; HASH_ITER(hh, *src_head, e, tmp) { diff --git a/src/modules/wasm.c b/src/modules/wasm.c index fc58d97..e53d414 100644 --- a/src/modules/wasm.c +++ b/src/modules/wasm.c @@ -373,7 +373,6 @@ static ant_value_t wasm_wrap_module(ant_t *js, wasm_store_t *store, wasm_module_ } static void wasm_module_finalize(ant_t *js, ant_object_t *obj) { - (void)js; if (!obj->extra_slots) return; ant_extra_slot_t *entries = (ant_extra_slot_t *)obj->extra_slots; @@ -398,7 +397,6 @@ static ant_value_t wasm_wrap_instance(ant_t *js, wasm_instance_handle_t *handle, } static void wasm_instance_finalize(ant_t *js, ant_object_t *obj) { - (void)js; if (!obj->extra_slots) return; ant_extra_slot_t *entries = (ant_extra_slot_t *)obj->extra_slots; @@ -440,7 +438,6 @@ static ant_value_t wasm_wrap_extern_object(ant_t *js, wasm_extern_wrap_kind_t ki } static void wasm_extern_finalize(ant_t *js, ant_object_t *obj) { - (void)js; if (!obj->extra_slots) return; ant_extra_slot_t *entries = (ant_extra_slot_t *)obj->extra_slots; diff --git a/src/repl.c b/src/repl.c index d0b462d..f1de0a5 100644 --- a/src/repl.c +++ b/src/repl.c @@ -402,7 +402,6 @@ static cmd_result_t cmd_load(ant_t *js, history_t *history, const char *arg) { } static cmd_result_t cmd_save(ant_t *js, history_t *history, const char *arg) { - (void)js; if (!arg || *arg == '\0') { fprintf(stderr, "Usage: .save \n"); return CMD_OK;