Skip to content

Commit 246090a

Browse files
authored
Remove unused context argument from JS_IsBigInt (#1063)
1 parent 35fb984 commit 246090a

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

quickjs-libc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,7 @@ static JSValue js_os_seek(JSContext *ctx, JSValueConst this_val,
18841884

18851885
if (JS_ToInt32(ctx, &fd, argv[0]))
18861886
return JS_EXCEPTION;
1887-
is_bigint = JS_IsBigInt(ctx, argv[1]);
1887+
is_bigint = JS_IsBigInt(argv[1]);
18881888
if (JS_ToInt64Ext(ctx, &pos, argv[1]))
18891889
return JS_EXCEPTION;
18901890
if (JS_ToInt32(ctx, &whence, argv[2]))

quickjs.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12497,7 +12497,7 @@ int JS_ToInt64(JSContext *ctx, int64_t *pres, JSValueConst val)
1249712497

1249812498
int JS_ToInt64Ext(JSContext *ctx, int64_t *pres, JSValueConst val)
1249912499
{
12500-
if (JS_IsBigInt(ctx, val))
12500+
if (JS_IsBigInt(val))
1250112501
return JS_ToBigInt64(ctx, pres, val);
1250212502
else
1250312503
return JS_ToInt64(ctx, pres, val);
@@ -46894,7 +46894,7 @@ static JSValue js_json_check(JSContext *ctx, JSONStringifyContext *jsc,
4689446894
JSValue v;
4689546895
JSValueConst args[2];
4689646896

46897-
if (JS_IsObject(val) || JS_IsBigInt(ctx, val)) {
46897+
if (JS_IsObject(val) || JS_IsBigInt(val)) {
4689846898
JSValue f = JS_GetProperty(ctx, val, JS_ATOM_toJSON);
4689946899
if (JS_IsException(f))
4690046900
goto exception;
@@ -53042,13 +53042,13 @@ static JSValue js_bigint_constructor(JSContext *ctx,
5304253042

5304353043
static JSValue js_thisBigIntValue(JSContext *ctx, JSValueConst this_val)
5304453044
{
53045-
if (JS_IsBigInt(ctx, this_val))
53045+
if (JS_IsBigInt(this_val))
5304653046
return js_dup(this_val);
5304753047

5304853048
if (JS_VALUE_GET_TAG(this_val) == JS_TAG_OBJECT) {
5304953049
JSObject *p = JS_VALUE_GET_OBJ(this_val);
5305053050
if (p->class_id == JS_CLASS_BIG_INT) {
53051-
if (JS_IsBigInt(ctx, p->u.object_data))
53051+
if (JS_IsBigInt(p->u.object_data))
5305253052
return js_dup(p->u.object_data);
5305353053
}
5305453054
}

quickjs.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -688,9 +688,8 @@ static inline bool JS_IsNumber(JSValueConst v)
688688
return tag == JS_TAG_INT || JS_TAG_IS_FLOAT64(tag);
689689
}
690690

691-
static inline bool JS_IsBigInt(JSContext *ctx, JSValueConst v)
691+
static inline bool JS_IsBigInt(JSValueConst v)
692692
{
693-
(void)&ctx;
694693
int tag = JS_VALUE_GET_TAG(v);
695694
return tag == JS_TAG_BIG_INT || tag == JS_TAG_SHORT_BIG_INT;
696695
}

0 commit comments

Comments
 (0)