mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 11:57:35 +00:00
LibJS: Use existing variable instead of re-reading internal slot
This is an editorial change in the Temporal spec.
See: 8d62569
This commit is contained in:
parent
a7dfe9096c
commit
2ce3d4389a
1 changed files with 2 additions and 3 deletions
|
@ -1012,9 +1012,8 @@ JS_DEFINE_NATIVE_FUNCTION(ZonedDateTimePrototype::round)
|
||||||
// 16. Let startNs be instantStart.[[Nanoseconds]].
|
// 16. Let startNs be instantStart.[[Nanoseconds]].
|
||||||
auto& start_ns = instant_start->nanoseconds();
|
auto& start_ns = instant_start->nanoseconds();
|
||||||
|
|
||||||
// 17. Let endNs be ? AddZonedDateTime(startNs, timeZone, zonedDateTime.[[Calendar]], 0, 0, 0, 1, 0, 0, 0, 0, 0, 0).
|
// 17. Let endNs be ? AddZonedDateTime(startNs, timeZone, calendar, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0).
|
||||||
// TODO: Shouldn't `zonedDateTime.[[Calendar]]` be `calendar` for consistency?
|
auto* end_ns = TRY(add_zoned_date_time(global_object, start_ns, &time_zone, calendar, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0));
|
||||||
auto* end_ns = TRY(add_zoned_date_time(global_object, start_ns, &time_zone, zoned_date_time->calendar(), 0, 0, 0, 1, 0, 0, 0, 0, 0, 0));
|
|
||||||
|
|
||||||
// 18. Let dayLengthNs be ℝ(endNs - startNs).
|
// 18. Let dayLengthNs be ℝ(endNs - startNs).
|
||||||
auto day_length_ns = end_ns->big_integer().minus(start_ns.big_integer()).to_double();
|
auto day_length_ns = end_ns->big_integer().minus(start_ns.big_integer()).to_double();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue