Skip to content

Commit dfdf15e

Browse files
harumazzzsaghul
authored andcommitted
Add JS_IsWeakSet
1 parent 0a893c7 commit dfdf15e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

quickjs.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10282,6 +10282,13 @@ bool JS_IsWeakRef(JSValueConst val)
1028210282
return JS_VALUE_GET_OBJ(val)->class_id == JS_CLASS_WEAK_REF;
1028310283
}
1028410284

10285+
bool JS_IsWeakSet(JSValueConst val)
10286+
{
10287+
if (JS_VALUE_GET_TAG(val) != JS_TAG_OBJECT)
10288+
return false;
10289+
return JS_VALUE_GET_OBJ(val)->class_id == JS_CLASS_WEAKSET;
10290+
}
10291+
1028510292
bool JS_IsError(JSContext *ctx, JSValueConst val)
1028610293
{
1028710294
JSObject *p;

quickjs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,7 @@ JS_EXTERN bool JS_IsRegExp(JSValueConst val);
833833
JS_EXTERN bool JS_IsMap(JSValueConst val);
834834
JS_EXTERN bool JS_IsSet(JSValueConst val);
835835
JS_EXTERN bool JS_IsWeakRef(JSValueConst val);
836+
JS_EXTERN bool JS_IsWeakSet(JSValueConst val);
836837

837838
JS_EXTERN JSValue JS_NewArray(JSContext *ctx);
838839
// takes ownership of the values

0 commit comments

Comments
 (0)