浏览代码

LibJS: Add parentheses around modulo operation

This is an editorial change in the Temporal spec.

See: https://github.com/tc39/proposal-temporal/commit/90e4b34
Linus Groh 3 年之前
父节点
当前提交
aaa9524a52
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp

+ 1 - 1
Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp

@@ -176,7 +176,7 @@ ISOYearMonth balance_iso_year_month(double year, double month)
     // 2. Set year to year + floor((month - 1) / 12).
     // 2. Set year to year + floor((month - 1) / 12).
     year += floor((month - 1) / 12);
     year += floor((month - 1) / 12);
 
 
-    // 3. Set month to (month - 1) modulo 12 + 1.
+    // 3. Set month to ((month - 1) modulo 12) + 1.
     month = modulo(month - 1, 12) + 1;
     month = modulo(month - 1, 12) + 1;
 
 
     // 4. Return the Record { [[Year]]: year, [[Month]]: month }.
     // 4. Return the Record { [[Year]]: year, [[Month]]: month }.