mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
LibJS: Remove faulty assertion in BalanceDurationRelative
This is an editorial change in the Temporal spec.
See: 66f7464
This commit is contained in:
parent
d2c1dd5454
commit
2b764b3594
2 changed files with 17 additions and 2 deletions
|
@ -783,8 +783,11 @@ ThrowCompletionOr<DateDurationRecord> balance_duration_relative(GlobalObject& gl
|
|||
return create_date_duration_record(years, months, weeks, days);
|
||||
}
|
||||
|
||||
// 2. Assert: relativeTo is not undefined, because callers of this operation ensure relativeTo is required in conditions where this algorithm does not return in step 1.a.
|
||||
VERIFY(!relative_to_value.is_undefined());
|
||||
// 2. If relativeTo is undefined, then
|
||||
if (relative_to_value.is_undefined()) {
|
||||
// a. Throw a RangeError exception.
|
||||
return vm.throw_completion<RangeError>(global_object, ErrorType::TemporalMissingStartingPoint, "calendar units");
|
||||
}
|
||||
|
||||
// 3. Let sign be ! DurationSign(years, months, weeks, days, 0, 0, 0, 0, 0, 0).
|
||||
auto sign = duration_sign(years, months, weeks, days, 0, 0, 0, 0, 0, 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue