diff options
author | Linus Groh <mail@linusgroh.de> | 2022-06-23 23:08:08 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-06-24 22:12:03 +0100 |
commit | 26990ab41ce1e2b39a2563a47c9c704be6c37ac6 (patch) | |
tree | 3e058b6d48c949ccb2a5569bb985b03631e78986 /Userland/Libraries/LibJS | |
parent | 709e16004daf1e1ff4ea1e728f5219ff47e10e44 (diff) | |
download | serenity-26990ab41ce1e2b39a2563a47c9c704be6c37ac6.zip |
LibJS: Mark PlainTime.prototype.round's CreateTemporalTime infallible
This is an editorial change in the Temporal spec.
See: https://github.com/tc39/proposal-temporal/commit/6b57938
Diffstat (limited to 'Userland/Libraries/LibJS')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp index f542effa6b..b0508c1791 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTimePrototype.cpp @@ -308,8 +308,8 @@ JS_DEFINE_NATIVE_FUNCTION(PlainTimePrototype::round) // 10. Let result be ! RoundTime(temporalTime.[[ISOHour]], temporalTime.[[ISOMinute]], temporalTime.[[ISOSecond]], temporalTime.[[ISOMillisecond]], temporalTime.[[ISOMicrosecond]], temporalTime.[[ISONanosecond]], roundingIncrement, smallestUnit, roundingMode). auto result = round_time(temporal_time->iso_hour(), temporal_time->iso_minute(), temporal_time->iso_second(), temporal_time->iso_millisecond(), temporal_time->iso_microsecond(), temporal_time->iso_nanosecond(), rounding_increment, *smallest_unit, rounding_mode); - // 11. Return ? CreateTemporalTime(result.[[Hour]], result.[[Minute]], result.[[Second]], result.[[Millisecond]], result.[[Microsecond]], result.[[Nanosecond]]). - return TRY(create_temporal_time(global_object, result.hour, result.minute, result.second, result.millisecond, result.microsecond, result.nanosecond)); + // 11. Return ! CreateTemporalTime(result.[[Hour]], result.[[Minute]], result.[[Second]], result.[[Millisecond]], result.[[Microsecond]], result.[[Nanosecond]]). + return MUST(create_temporal_time(global_object, result.hour, result.minute, result.second, result.millisecond, result.microsecond, result.nanosecond)); } // 4.3.16 Temporal.PlainTime.prototype.equals ( other ), https://tc39.es/proposal-temporal/#sec-temporal.plaintime.prototype.equals |