|
@@ -50,35 +50,35 @@ ThrowCompletionOr<Object*> DurationConstructor::construct(FunctionObject& new_ta
|
|
|
{
|
|
|
auto& vm = this->vm();
|
|
|
|
|
|
- // 2. Let y be ? ToIntegerWithoutRounding(years).
|
|
|
- auto y = TRY(to_integer_without_rounding(vm, vm.argument(0), ErrorType::TemporalInvalidDuration));
|
|
|
+ // 2. Let y be ? ToIntegerIfIntegral(years).
|
|
|
+ auto y = TRY(to_integer_if_integral(vm, vm.argument(0), ErrorType::TemporalInvalidDuration));
|
|
|
|
|
|
- // 3. Let mo be ? ToIntegerWithoutRounding(months).
|
|
|
- auto mo = TRY(to_integer_without_rounding(vm, vm.argument(1), ErrorType::TemporalInvalidDuration));
|
|
|
+ // 3. Let mo be ? ToIntegerIfIntegral(months).
|
|
|
+ auto mo = TRY(to_integer_if_integral(vm, vm.argument(1), ErrorType::TemporalInvalidDuration));
|
|
|
|
|
|
- // 4. Let w be ? ToIntegerWithoutRounding(weeks).
|
|
|
- auto w = TRY(to_integer_without_rounding(vm, vm.argument(2), ErrorType::TemporalInvalidDuration));
|
|
|
+ // 4. Let w be ? ToIntegerIfIntegral(weeks).
|
|
|
+ auto w = TRY(to_integer_if_integral(vm, vm.argument(2), ErrorType::TemporalInvalidDuration));
|
|
|
|
|
|
- // 5. Let d be ? ToIntegerWithoutRounding(days).
|
|
|
- auto d = TRY(to_integer_without_rounding(vm, vm.argument(3), ErrorType::TemporalInvalidDuration));
|
|
|
+ // 5. Let d be ? ToIntegerIfIntegral(days).
|
|
|
+ auto d = TRY(to_integer_if_integral(vm, vm.argument(3), ErrorType::TemporalInvalidDuration));
|
|
|
|
|
|
- // 6. Let h be ? ToIntegerWithoutRounding(hours).
|
|
|
- auto h = TRY(to_integer_without_rounding(vm, vm.argument(4), ErrorType::TemporalInvalidDuration));
|
|
|
+ // 6. Let h be ? ToIntegerIfIntegral(hours).
|
|
|
+ auto h = TRY(to_integer_if_integral(vm, vm.argument(4), ErrorType::TemporalInvalidDuration));
|
|
|
|
|
|
- // 7. Let m be ? ToIntegerWithoutRounding(minutes).
|
|
|
- auto m = TRY(to_integer_without_rounding(vm, vm.argument(5), ErrorType::TemporalInvalidDuration));
|
|
|
+ // 7. Let m be ? ToIntegerIfIntegral(minutes).
|
|
|
+ auto m = TRY(to_integer_if_integral(vm, vm.argument(5), ErrorType::TemporalInvalidDuration));
|
|
|
|
|
|
- // 8. Let s be ? ToIntegerWithoutRounding(seconds).
|
|
|
- auto s = TRY(to_integer_without_rounding(vm, vm.argument(6), ErrorType::TemporalInvalidDuration));
|
|
|
+ // 8. Let s be ? ToIntegerIfIntegral(seconds).
|
|
|
+ auto s = TRY(to_integer_if_integral(vm, vm.argument(6), ErrorType::TemporalInvalidDuration));
|
|
|
|
|
|
- // 9. Let ms be ? ToIntegerWithoutRounding(milliseconds).
|
|
|
- auto ms = TRY(to_integer_without_rounding(vm, vm.argument(7), ErrorType::TemporalInvalidDuration));
|
|
|
+ // 9. Let ms be ? ToIntegerIfIntegral(milliseconds).
|
|
|
+ auto ms = TRY(to_integer_if_integral(vm, vm.argument(7), ErrorType::TemporalInvalidDuration));
|
|
|
|
|
|
- // 10. Let mis be ? ToIntegerWithoutRounding(microseconds).
|
|
|
- auto mis = TRY(to_integer_without_rounding(vm, vm.argument(8), ErrorType::TemporalInvalidDuration));
|
|
|
+ // 10. Let mis be ? ToIntegerIfIntegral(microseconds).
|
|
|
+ auto mis = TRY(to_integer_if_integral(vm, vm.argument(8), ErrorType::TemporalInvalidDuration));
|
|
|
|
|
|
- // 11. Let ns be ? ToIntegerWithoutRounding(nanoseconds).
|
|
|
- auto ns = TRY(to_integer_without_rounding(vm, vm.argument(9), ErrorType::TemporalInvalidDuration));
|
|
|
+ // 11. Let ns be ? ToIntegerIfIntegral(nanoseconds).
|
|
|
+ auto ns = TRY(to_integer_if_integral(vm, vm.argument(9), ErrorType::TemporalInvalidDuration));
|
|
|
|
|
|
// 12. Return ? CreateTemporalDuration(y, mo, w, d, h, m, s, ms, mis, ns, NewTarget).
|
|
|
return TRY(create_temporal_duration(vm, y, mo, w, d, h, m, s, ms, mis, ns, &new_target));
|