Browse Source

LibJS: Mark GetEpochFromISOParts as infallible

This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/66ea81b
Linus Groh 3 năm trước cách đây
mục cha
commit
60ee542612
1 tập tin đã thay đổi với 1 bổ sung3 xóa
  1. 1 3
      Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp

+ 1 - 3
Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp

@@ -115,10 +115,8 @@ ThrowCompletionOr<BigInt*> parse_temporal_instant(GlobalObject& global_object, S
     // 4. Assert: offsetString is not undefined.
     VERIFY(offset_string.has_value());
 
-    // 5. Let utc be ? GetEpochFromISOParts(result.[[Year]], result.[[Month]], result.[[Day]], result.[[Hour]], result.[[Minute]], result.[[Second]], result.[[Millisecond]], result.[[Microsecond]], result.[[Nanosecond]]).
+    // 5. Let utc be ! GetEpochFromISOParts(result.[[Year]], result.[[Month]], result.[[Day]], result.[[Hour]], result.[[Minute]], result.[[Second]], result.[[Millisecond]], result.[[Microsecond]], result.[[Nanosecond]]).
     auto* utc = get_epoch_from_iso_parts(global_object, result.year, result.month, result.day, result.hour, result.minute, result.second, result.millisecond, result.microsecond, result.nanosecond);
-    if (auto* exception = vm.exception())
-        return throw_completion(exception->value());
 
     // 6. If utc < −8.64 × 10^21 or utc > 8.64 × 10^21, then
     if (utc->big_integer() < INSTANT_NANOSECONDS_MIN || utc->big_integer() > INSTANT_NANOSECONDS_MAX) {