mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
Add JS_IsRegExp function (#804)
This commit is contained in:
parent
36e3513d4e
commit
6d64933328
2 changed files with 9 additions and 0 deletions
|
@ -10100,6 +10100,13 @@ BOOL JS_SetConstructorBit(JSContext *ctx, JSValue func_obj, BOOL val)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
JS_BOOL JS_IsRegExp(JSValue val)
|
||||
{
|
||||
if (JS_VALUE_GET_TAG(val) != JS_TAG_OBJECT)
|
||||
return FALSE;
|
||||
return JS_VALUE_GET_OBJ(val)->class_id == JS_CLASS_REGEXP;
|
||||
}
|
||||
|
||||
BOOL JS_IsError(JSContext *ctx, JSValue val)
|
||||
{
|
||||
JSObject *p;
|
||||
|
|
|
@ -672,6 +672,8 @@ JS_EXTERN JS_BOOL JS_IsFunction(JSContext* ctx, JSValue val);
|
|||
JS_EXTERN JS_BOOL JS_IsConstructor(JSContext* ctx, JSValue val);
|
||||
JS_EXTERN JS_BOOL JS_SetConstructorBit(JSContext *ctx, JSValue func_obj, JS_BOOL val);
|
||||
|
||||
JS_EXTERN JS_BOOL JS_IsRegExp(JSValue val);
|
||||
|
||||
JS_EXTERN JSValue JS_NewArray(JSContext *ctx);
|
||||
JS_EXTERN int JS_IsArray(JSContext *ctx, JSValue val);
|
||||
|
||||
|
|
Loading…
Reference in a new issue