mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-13 11:39:43 +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:
parent
85327e6b5d
commit
151eb8606d
Notes:
sideshowbarker
2024-07-17 14:18:47 +09:00
Author: https://github.com/linusg
Commit: 151eb8606d
Pull-request: https://github.com/SerenityOS/serenity/pull/13550
Reviewed-by: https://github.com/IdanHo
Reviewed-by: https://github.com/ldm5180 ✅
21 changed files with 226 additions and 261 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue