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

LibJS: Replace GlobalObject with VM in common AOs [Part 18/19]

This commit is contained in:
Linus Groh 2022-08-21 19:24:32 +01:00
parent 7856886ed5
commit 25849f8a6d
95 changed files with 536 additions and 677 deletions

View file

@ -48,13 +48,12 @@ ThrowCompletionOr<Value> DateTimeFormatConstructor::call()
ThrowCompletionOr<Object*> DateTimeFormatConstructor::construct(FunctionObject& new_target)
{
auto& vm = this->vm();
auto& global_object = this->global_object();
auto locales = vm.argument(0);
auto options = vm.argument(1);
// 2. Let dateTimeFormat be ? OrdinaryCreateFromConstructor(newTarget, "%DateTimeFormat.prototype%", « [[InitializedDateTimeFormat]], [[Locale]], [[Calendar]], [[NumberingSystem]], [[TimeZone]], [[Weekday]], [[Era]], [[Year]], [[Month]], [[Day]], [[DayPeriod]], [[Hour]], [[Minute]], [[Second]], [[FractionalSecondDigits]], [[TimeZoneName]], [[HourCycle]], [[Pattern]], [[BoundFormat]] »).
auto* date_time_format = TRY(ordinary_create_from_constructor<DateTimeFormat>(global_object, new_target, &GlobalObject::intl_date_time_format_prototype));
auto* date_time_format = TRY(ordinary_create_from_constructor<DateTimeFormat>(vm, new_target, &GlobalObject::intl_date_time_format_prototype));
// 3. Perform ? InitializeDateTimeFormat(dateTimeFormat, locales, options).
TRY(initialize_date_time_format(vm, *date_time_format, locales, options));