1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:37:45 +00:00

LibJS: Define IsBuiltinCalendar in terms of AvailableCalendars

This is an editorial change in the Temporal spec.

See: 896b72d
This commit is contained in:
Linus Groh 2022-04-29 18:42:56 +02:00
parent 2499911898
commit aac457755d
3 changed files with 79 additions and 65 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
* Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -50,7 +50,7 @@ ThrowCompletionOr<Object*> CalendarConstructor::construct(FunctionObject& new_ta
// 2. Set id to ? ToString(id).
auto identifier = TRY(vm.argument(0).to_string(global_object));
// 3. If ! IsBuiltinCalendar(id) is false, then
// 3. If IsBuiltinCalendar(id) is false, then
if (!is_builtin_calendar(identifier)) {
// a. Throw a RangeError exception.
return vm.throw_completion<RangeError>(global_object, ErrorType::TemporalInvalidCalendarIdentifier, identifier);