Skip to content

Commit

Permalink
Add JS_GetLength
Browse files Browse the repository at this point in the history
  • Loading branch information
Icemic authored and chqrlie committed May 27, 2024
1 parent 9a2a246 commit 569f51f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -6970,6 +6970,10 @@ static JSValue JS_GetPrototypeFree(JSContext *ctx, JSValue obj)
return obj1;
}

int JS_GetLength(JSContext *ctx, JSValue obj, int64_t *pres) {
return js_get_length64(ctx, pres, obj);
}

/* return TRUE, FALSE or (-1) in case of exception */
static int JS_OrdinaryIsInstanceOf(JSContext *ctx, JSValue val,
JSValue obj)
Expand Down
1 change: 1 addition & 0 deletions quickjs.h
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ JS_EXTERN int JS_PreventExtensions(JSContext *ctx, JSValue obj);
JS_EXTERN int JS_DeleteProperty(JSContext *ctx, JSValue obj, JSAtom prop, int flags);
JS_EXTERN int JS_SetPrototype(JSContext *ctx, JSValue obj, JSValue proto_val);
JS_EXTERN JSValue JS_GetPrototype(JSContext *ctx, JSValue val);
JS_EXTERN int JS_GetLength(JSContext *ctx, JSValue obj, int64_t *pres);

#define JS_GPN_STRING_MASK (1 << 0)
#define JS_GPN_SYMBOL_MASK (1 << 1)
Expand Down

0 comments on commit 569f51f

Please sign in to comment.