1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:57:35 +00:00

LibJS: Use OrdinaryCreateFromConstructor() in a bunch of constructors

Resolves various FIXMEs :^)
This commit is contained in:
Linus Groh 2021-06-20 01:09:39 +01:00 committed by Andreas Kling
parent e5753443ae
commit 8f6ac0db1c
16 changed files with 173 additions and 102 deletions

View file

@ -19,15 +19,6 @@ Date* Date::create(GlobalObject& global_object, Core::DateTime datetime, i16 mil
return global_object.heap().allocate<Date>(global_object, datetime, milliseconds, is_invalid, *global_object.date_prototype());
}
Date* Date::now(GlobalObject& global_object)
{
struct timeval tv;
gettimeofday(&tv, nullptr);
auto datetime = Core::DateTime::now();
auto milliseconds = static_cast<i16>(tv.tv_usec / 1000);
return create(global_object, datetime, milliseconds);
}
Date::Date(Core::DateTime datetime, i16 milliseconds, bool is_invalid, Object& prototype)
: Object(prototype)
, m_datetime(datetime)