diff options
Diffstat (limited to 'lib/quickjs/quickjs.c')
-rw-r--r-- | lib/quickjs/quickjs.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/quickjs/quickjs.c b/lib/quickjs/quickjs.c index 2d50e247..52f1d159 100644 --- a/lib/quickjs/quickjs.c +++ b/lib/quickjs/quickjs.c @@ -9886,6 +9886,15 @@ void *JS_GetOpaque2(JSContext *ctx, JSValueConst obj, JSClassID class_id) return p; } +JSClassID JS_GetClassID(JSValueConst obj) +{ + JSObject *p; + if (JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT) + return 0; + p = JS_VALUE_GET_OBJ(obj); + return p->class_id; +} + #define HINT_STRING 0 #define HINT_NUMBER 1 #define HINT_NONE 2 |