fix: 修复数组长度与槽位索引截断问题

This commit is contained in:
2026-06-08 22:55:52 +08:00
parent 838f216ea3
commit 6cb781a3bd
16 changed files with 242 additions and 159 deletions
@@ -143,6 +143,10 @@ fn string_split_comma() {
let mut vm = Vm::new();
let result = eval(&mut vm, "'a,b,c'.split(',')").unwrap();
assert!(result.is_object());
let obj = unsafe { &*result.as_js_object_ptr() };
assert_eq!(obj.prop_count(), 3);
assert_eq!(to_str(&vm, obj.get_prop_at(0)), "a");
assert_eq!(to_str(&vm, obj.get_prop_at(2)), "c");
}
#[test]