Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -51266,6 +51266,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;
Expand Down
1 change: 1 addition & 0 deletions quickjs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading