Skip to content

Commit e5673a8

Browse files
committed
Add JS_ToBigUint64
Fixes: #376
1 parent c7bd411 commit e5673a8

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

quickjs.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12026,6 +12026,11 @@ int JS_ToBigInt64(JSContext *ctx, int64_t *pres, JSValue val)
1202612026
return JS_ToBigInt64Free(ctx, pres, js_dup(val));
1202712027
}
1202812028

12029+
int JS_ToBigUint64(JSContext *ctx, uint64_t *pres, JSValue val)
12030+
{
12031+
return JS_ToBigInt64Free(ctx, (int64_t *)pres, js_dup(val));
12032+
}
12033+
1202912034
static JSValue JS_NewBigInt(JSContext *ctx)
1203012035
{
1203112036
JSBigInt *p;

quickjs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,7 @@ JS_EXTERN int JS_ToIndex(JSContext *ctx, uint64_t *plen, JSValue val);
638638
JS_EXTERN int JS_ToFloat64(JSContext *ctx, double *pres, JSValue val);
639639
/* return an exception if 'val' is a Number */
640640
JS_EXTERN int JS_ToBigInt64(JSContext *ctx, int64_t *pres, JSValue val);
641+
JS_EXTERN int JS_ToBigUint64(JSContext *ctx, uint64_t *pres, JSValue val);
641642
/* same as JS_ToInt64() but allow BigInt */
642643
JS_EXTERN int JS_ToInt64Ext(JSContext *ctx, int64_t *pres, JSValue val);
643644

0 commit comments

Comments
 (0)