Skip to content

Commit 3b56010

Browse files
committedMay 23, 2024
Add JS_GetLength
1 parent 0f453d3 commit 3b56010

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
@@ -6975,6 +6975,10 @@ static JSValue JS_GetPrototypeFree(JSContext *ctx, JSValue obj)
69756975
return obj1;
69766976
}
69776977

6978+
int JS_GetLength(JSContext *ctx, JSValue obj, int64_t *pres) {
6979+
return js_get_length64(ctx, pres, obj);
6980+
}
6981+
69786982
/* return TRUE, FALSE or (-1) in case of exception */
69796983
static int JS_OrdinaryIsInstanceOf(JSContext *ctx, JSValue val,
69806984
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)