Skip to content

Remove unused JSContext argument #1072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,7 @@ static JSValue js_typed_array_constructor_ta(JSContext *ctx,
int classid, uint32_t len);
static bool is_typed_array(JSClassID class_id);
static bool typed_array_is_oob(JSObject *p);
static uint32_t typed_array_get_length(JSContext *ctx, JSObject *p);
static uint32_t typed_array_length(JSObject *p);
static JSValue JS_ThrowTypeErrorDetachedArrayBuffer(JSContext *ctx);
static JSValue JS_ThrowTypeErrorArrayBufferOOB(JSContext *ctx);
static JSVarRef *get_var_ref(JSContext *ctx, JSStackFrame *sf, int var_idx,
Expand Down Expand Up @@ -54092,7 +54092,7 @@ static bool typed_array_is_oob(JSObject *p)

/* WARNING: 'p' must be a typed array. Works even if the array buffer
is detached */
static uint32_t typed_array_get_length(JSContext *ctx, JSObject *p)
static uint32_t typed_array_length(JSObject *p)
{
JSTypedArray *ta = p->u.typed_array;
int size_log2 = typed_array_size_log2(p->class_id);
Expand Down Expand Up @@ -54870,7 +54870,7 @@ static JSValue js_typed_array_indexOf(JSContext *ctx, JSValueConst this_val,
/* "includes" scans all the properties, so "undefined" can match */
if (special == special_includes)
if (JS_IsUndefined(argv[0]))
if (k < typed_array_get_length(ctx, p))
if (k < typed_array_length(p))
res = 0;
goto done;
}
Expand Down Expand Up @@ -55311,8 +55311,8 @@ static JSValue js_typed_array_slice(JSContext *ctx, JSValueConst this_val,

p1 = get_typed_array(ctx, arr);
if (p1 != NULL && p->class_id == p1->class_id &&
typed_array_get_length(ctx, p1) >= count &&
typed_array_get_length(ctx, p) >= start + count) {
typed_array_length(p1) >= count &&
typed_array_length(p) >= start + count) {
shift = typed_array_size_log2(p->class_id);
memmove(p1->u.array.u.uint8_ptr,
p->u.array.u.uint8_ptr + (start << shift),
Expand Down