mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 10:41:11 +08:00
fix: 本地日期分量换算改走本地时区映射并消除负索引溢出
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user