mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
Add JS_IsDate function (#803)
This commit is contained in:
parent
0fb7f4e208
commit
36e3513d4e
2 changed files with 8 additions and 0 deletions
|
@ -51280,6 +51280,13 @@ JSValue JS_NewDate(JSContext *ctx, double epoch_ms)
|
|||
return obj;
|
||||
}
|
||||
|
||||
JS_BOOL JS_IsDate(JSValue v)
|
||||
{
|
||||
if (JS_VALUE_GET_TAG(v) != JS_TAG_OBJECT)
|
||||
return FALSE;
|
||||
return JS_VALUE_GET_OBJ(v)->class_id == JS_CLASS_DATE;
|
||||
}
|
||||
|
||||
void JS_AddIntrinsicDate(JSContext *ctx)
|
||||
{
|
||||
JSValue obj;
|
||||
|
|
|
@ -676,6 +676,7 @@ JS_EXTERN JSValue JS_NewArray(JSContext *ctx);
|
|||
JS_EXTERN int JS_IsArray(JSContext *ctx, JSValue val);
|
||||
|
||||
JS_EXTERN JSValue JS_NewDate(JSContext *ctx, double epoch_ms);
|
||||
JS_EXTERN JS_BOOL JS_IsDate(JSValue v);
|
||||
|
||||
JS_EXTERN JSValue JS_GetProperty(JSContext *ctx, JSValue this_obj, JSAtom prop);
|
||||
JS_EXTERN JSValue JS_GetPropertyUint32(JSContext *ctx, JSValue this_obj,
|
||||
|
|
Loading…
Reference in a new issue