1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:07:45 +00:00

LibJS: Follow rules for consuming completion records

This is an editorial change in the Temporal spec.

See: 1c19b96
This commit is contained in:
Linus Groh 2022-03-10 18:05:50 +01:00
parent 2bae040bc9
commit 68af8649fb
21 changed files with 78 additions and 78 deletions

View file

@ -432,7 +432,7 @@ ThrowCompletionOr<Object*> to_temporal_time_zone(GlobalObject& global_object, Va
// 4. If parseResult.[[Name]] is not undefined, then
if (parse_result.name.has_value()) {
// a. If ParseText(! StringToCodePoints(parseResult.[[Name]], TimeZoneNumericUTCOffset)) is not a List of errors, then
// a. If ParseText(StringToCodePoints(parseResult.[[Name]], TimeZoneNumericUTCOffset)) is not a List of errors, then
if (is_valid_time_zone_numeric_utc_offset_syntax(*parse_result.name)) {
// i. If parseResult.[[OffsetString]] is not undefined, and ! ParseTimeZoneOffsetString(parseResult.[[OffsetString]]) ≠ ! ParseTimeZoneOffsetString(parseResult.[[Name]]), throw a RangeError exception.
if (parse_result.offset_string.has_value() && (MUST(parse_time_zone_offset_string(global_object, *parse_result.offset_string)) != MUST(parse_time_zone_offset_string(global_object, *parse_result.name))))
@ -472,7 +472,7 @@ ThrowCompletionOr<double> get_offset_nanoseconds_for(GlobalObject& global_object
if (!offset_nanoseconds_value.is_number())
return vm.throw_completion<TypeError>(global_object, ErrorType::IsNotA, "Offset nanoseconds value", "number");
// 4. If ! IsIntegralNumber(offsetNanoseconds) is false, throw a RangeError exception.
// 4. If IsIntegralNumber(offsetNanoseconds) is false, throw a RangeError exception.
if (!offset_nanoseconds_value.is_integral_number())
return vm.throw_completion<RangeError>(global_object, ErrorType::IsNotAn, "Offset nanoseconds value", "integral number");