Skip to content

Commit aa36afe

Browse files
harumazzzsaghul
authored andcommitted
Add JS_IsDataView
1 parent d6f5369 commit aa36afe

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
@@ -10296,6 +10296,13 @@ bool JS_IsWeakMap(JSValueConst val)
1029610296
return JS_VALUE_GET_OBJ(val)->class_id == JS_CLASS_WEAKMAP;
1029710297
}
1029810298

10299+
bool JS_IsDataView(JSValueConst val)
10300+
{
10301+
if (JS_VALUE_GET_TAG(val) != JS_TAG_OBJECT)
10302+
return false;
10303+
return JS_VALUE_GET_OBJ(val)->class_id == JS_CLASS_DATAVIEW;
10304+
}
10305+
1029910306
bool JS_IsError(JSContext *ctx, JSValueConst val)
1030010307
{
1030110308
JSObject *p;

quickjs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,7 @@ JS_EXTERN bool JS_IsSet(JSValueConst val);
835835
JS_EXTERN bool JS_IsWeakRef(JSValueConst val);
836836
JS_EXTERN bool JS_IsWeakSet(JSValueConst val);
837837
JS_EXTERN bool JS_IsWeakMap(JSValueConst val);
838+
JS_EXTERN bool JS_IsDataView(JSValueConst val);
838839

839840
JS_EXTERN JSValue JS_NewArray(JSContext *ctx);
840841
// takes ownership of the values

0 commit comments

Comments
 (0)