Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion quickjs-libc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1884,7 +1884,7 @@ static JSValue js_os_seek(JSContext *ctx, JSValueConst this_val,

if (JS_ToInt32(ctx, &fd, argv[0]))
return JS_EXCEPTION;
is_bigint = JS_IsBigInt(ctx, argv[1]);
is_bigint = JS_IsBigInt(argv[1]);
if (JS_ToInt64Ext(ctx, &pos, argv[1]))
return JS_EXCEPTION;
if (JS_ToInt32(ctx, &whence, argv[2]))
Expand Down
8 changes: 4 additions & 4 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -12493,7 +12493,7 @@ int JS_ToInt64(JSContext *ctx, int64_t *pres, JSValueConst val)

int JS_ToInt64Ext(JSContext *ctx, int64_t *pres, JSValueConst val)
{
if (JS_IsBigInt(ctx, val))
if (JS_IsBigInt(val))
return JS_ToBigInt64(ctx, pres, val);
else
return JS_ToInt64(ctx, pres, val);
Expand Down Expand Up @@ -46876,7 +46876,7 @@ static JSValue js_json_check(JSContext *ctx, JSONStringifyContext *jsc,
JSValue v;
JSValueConst args[2];

if (JS_IsObject(val) || JS_IsBigInt(ctx, val)) {
if (JS_IsObject(val) || JS_IsBigInt(val)) {
JSValue f = JS_GetProperty(ctx, val, JS_ATOM_toJSON);
if (JS_IsException(f))
goto exception;
Expand Down Expand Up @@ -53024,13 +53024,13 @@ static JSValue js_bigint_constructor(JSContext *ctx,

static JSValue js_thisBigIntValue(JSContext *ctx, JSValueConst this_val)
{
if (JS_IsBigInt(ctx, this_val))
if (JS_IsBigInt(this_val))
return js_dup(this_val);

if (JS_VALUE_GET_TAG(this_val) == JS_TAG_OBJECT) {
JSObject *p = JS_VALUE_GET_OBJ(this_val);
if (p->class_id == JS_CLASS_BIG_INT) {
if (JS_IsBigInt(ctx, p->u.object_data))
if (JS_IsBigInt(p->u.object_data))
return js_dup(p->u.object_data);
}
}
Expand Down
3 changes: 1 addition & 2 deletions quickjs.h
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,8 @@ static inline bool JS_IsNumber(JSValueConst v)
return tag == JS_TAG_INT || JS_TAG_IS_FLOAT64(tag);
}

static inline bool JS_IsBigInt(JSContext *ctx, JSValueConst v)
static inline bool JS_IsBigInt(JSValueConst v)
{
(void)&ctx;
int tag = JS_VALUE_GET_TAG(v);
return tag == JS_TAG_BIG_INT || tag == JS_TAG_SHORT_BIG_INT;
}
Expand Down