1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

LibJS: Implement Temporal.Instant.prototype.toString()

This commit is contained in:
Linus Groh 2021-08-31 00:15:36 +01:00 committed by Andreas Kling
parent 1c65ee6edf
commit 576be0f8e7
14 changed files with 396 additions and 6 deletions

View file

@ -416,12 +416,12 @@ double get_offset_nanoseconds_for(GlobalObject& global_object, Value time_zone,
}
// 11.6.12 BuiltinTimeZoneGetOffsetStringFor ( timeZone, instant ), https://tc39.es/proposal-temporal/#sec-temporal-builtintimezonegetoffsetstringfor
Optional<String> builtin_time_zone_get_offset_string_for(GlobalObject& global_object, Object& time_zone, Instant& instant)
Optional<String> builtin_time_zone_get_offset_string_for(GlobalObject& global_object, Value time_zone, Instant& instant)
{
auto& vm = global_object.vm();
// 1. Let offsetNanoseconds be ? GetOffsetNanosecondsFor(timeZone, instant).
auto offset_nanoseconds = get_offset_nanoseconds_for(global_object, &time_zone, instant);
auto offset_nanoseconds = get_offset_nanoseconds_for(global_object, time_zone, instant);
if (vm.exception())
return {};