1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:47:36 +00:00

LibJS: Use new construct AO overload where easily applicable

This commit is contained in:
Timothy Flynn 2022-01-25 15:06:40 -05:00 committed by Linus Groh
parent 67e02f6ca6
commit 59ca435172
10 changed files with 16 additions and 55 deletions

View file

@ -70,9 +70,7 @@ ThrowCompletionOr<Calendar*> get_builtin_calendar(GlobalObject& global_object, S
return vm.throw_completion<RangeError>(global_object, ErrorType::TemporalInvalidCalendarIdentifier, identifier);
// 2. Return ? Construct(%Temporal.Calendar%, « id »).
MarkedValueList arguments(vm.heap());
arguments.append(js_string(vm, identifier));
return static_cast<Calendar*>(TRY(construct(global_object, *global_object.temporal_calendar_constructor(), move(arguments))));
return static_cast<Calendar*>(TRY(construct(global_object, *global_object.temporal_calendar_constructor(), js_string(vm, identifier))));
}
// 12.1.4 GetISO8601Calendar ( ), https://tc39.es/proposal-temporal/#sec-temporal-getiso8601calendar