mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-26 19:51:11 +08:00
fix: split 委托 Symbol.split 并补零宽与 limit 口径
This commit is contained in:
@@ -789,6 +789,16 @@ fn symbol_split_limit_zero_and_to_uint32() {
|
||||
assert_eq!(to_str(&vm, result), "limit-boom");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn symbol_split_undefined_limit_full() {
|
||||
// limit 缺省与显式 undefined 均为 2^32-1 全量(非 ToUint32(NaN)=0)。
|
||||
let mut vm = Vm::new();
|
||||
let result = eval(&mut vm, "RegExp.prototype[Symbol.split].call(/,/, 'a,b', undefined).length").unwrap();
|
||||
assert!(result.as_int() == 2);
|
||||
let result = eval(&mut vm, "'a,b'.split(/,/, undefined).length").unwrap();
|
||||
assert!(result.as_int() == 2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn symbol_match_all_species_matcher_and_cached_lastindex() {
|
||||
let mut vm = Vm::new();
|
||||
|
||||
Reference in New Issue
Block a user