fix: 本地日期分量换算改走本地时区映射并消除负索引溢出

This commit is contained in:
2026-09-20 19:55:07 +00:00
parent c9e1ee2e09
commit d750d4a2b5
4 changed files with 163 additions and 80 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ fn normalize_index<H: VmHost>(vm: &mut H, value: JsValue, len: usize) -> usize {
}
let int = n.trunc() as isize;
if int < 0 {
len.saturating_sub((-int) as usize)
len.saturating_sub(int.unsigned_abs())
} else {
(int as usize).min(len)
}