Skip to content

Commit 569f51f

Browse files
Icemicchqrlie
authored andcommitted
Add JS_GetLength
1 parent 9a2a246 commit 569f51f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

quickjs.c

+4
Original file line numberDiff line numberDiff line change
@@ -6970,6 +6970,10 @@ static JSValue JS_GetPrototypeFree(JSContext *ctx, JSValue obj)
69706970
return obj1;
69716971
}
69726972

6973+
int JS_GetLength(JSContext *ctx, JSValue obj, int64_t *pres) {
6974+
return js_get_length64(ctx, pres, obj);
6975+
}
6976+
69736977
/* return TRUE, FALSE or (-1) in case of exception */
69746978
static int JS_OrdinaryIsInstanceOf(JSContext *ctx, JSValue val,
69756979
JSValue obj)

quickjs.h

+1
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,7 @@ JS_EXTERN int JS_PreventExtensions(JSContext *ctx, JSValue obj);
694694
JS_EXTERN int JS_DeleteProperty(JSContext *ctx, JSValue obj, JSAtom prop, int flags);
695695
JS_EXTERN int JS_SetPrototype(JSContext *ctx, JSValue obj, JSValue proto_val);
696696
JS_EXTERN JSValue JS_GetPrototype(JSContext *ctx, JSValue val);
697+
JS_EXTERN int JS_GetLength(JSContext *ctx, JSValue obj, int64_t *pres);
697698

698699
#define JS_GPN_STRING_MASK (1 << 0)
699700
#define JS_GPN_SYMBOL_MASK (1 << 1)

0 commit comments

Comments
 (0)