1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 03:57:44 +00:00

LibJS: Remove vm.construct and it's usages

This commit is contained in:
Idan Horowitz 2021-10-23 01:49:10 +03:00
parent 66770de264
commit e26d9f419b
11 changed files with 39 additions and 79 deletions

View file

@ -71,10 +71,7 @@ ThrowCompletionOr<Calendar*> get_builtin_calendar(GlobalObject& global_object, S
// 2. Return ? Construct(%Temporal.Calendar%, « id »).
MarkedValueList arguments(vm.heap());
arguments.append(js_string(vm, identifier));
auto calendar = vm.construct(*global_object.temporal_calendar_constructor(), *global_object.temporal_calendar_constructor(), move(arguments));
if (auto* exception = vm.exception())
return throw_completion(exception->value());
return static_cast<Calendar*>(&calendar.as_object());
return static_cast<Calendar*>(TRY(construct(global_object, *global_object.temporal_calendar_constructor(), move(arguments))));
}
// 12.1.4 GetISO8601Calendar ( )