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

LibJS: Consistently call observable Temporal AOs with undefined options

This is a normative change in the Temporal spec.

See: 6fa5b9d
This commit is contained in:
Linus Groh 2022-04-06 23:56:57 +01:00
parent 85327e6b5d
commit 151eb8606d
21 changed files with 226 additions and 261 deletions

View file

@ -73,11 +73,8 @@ ThrowCompletionOr<PlainDate*> to_temporal_date(GlobalObject& global_object, Valu
{
auto& vm = global_object.vm();
// 1. If options is not present, set options to OrdinaryObjectCreate(null).
if (!options)
options = Object::create(global_object, nullptr);
// 2. Assert: Type(options) is Object.
// 1. If options is not present, set options to undefined.
// 2. Assert: Type(options) is Object or Undefined.
// 3. If Type(item) is Object, then
if (item.is_object()) {
@ -123,7 +120,7 @@ ThrowCompletionOr<PlainDate*> to_temporal_date(GlobalObject& global_object, Valu
}
// 4. Perform ? ToTemporalOverflow(options).
(void)TRY(to_temporal_overflow(global_object, *options));
(void)TRY(to_temporal_overflow(global_object, options));
// 5. Let string be ? ToString(item).
auto string = TRY(item.to_string(global_object));