fix: RegExp source/flags 原型访问器与 GC 根追踪

This commit is contained in:
2026-09-21 14:56:19 +00:00
parent fea24b6d26
commit 8e22c48b70
6 changed files with 190 additions and 24 deletions
@@ -534,8 +534,9 @@ fn regexp_flag_accessor_descriptor_and_identity() {
#[test]
fn regexp_instance_has_no_own_flag_props() {
let mut vm = Vm::new();
// source/flags 是原型访问器,非实例自身属性;仅 lastIndex 为自身数据属性。
let result = eval(&mut vm, "Object.getOwnPropertyNames(new RegExp('a', 'g')).sort().join(',')").unwrap();
assert_eq!(to_str(&vm, result), "flags,lastIndex,source");
assert_eq!(to_str(&vm, result), "lastIndex");
}
#[test]