fix: pending_length_exception 登记 GC 根遍历与搬移重写

This commit is contained in:
2026-09-19 09:57:43 +00:00
parent 41bebaa05a
commit 0697cde219
2 changed files with 13 additions and 0 deletions
+11
View File
@@ -40,6 +40,17 @@ fn uncaught_value_is_gc_root() {
assert!(has_ptr(&roots, session));
}
#[test]
fn pending_length_exception_is_gc_root() {
let mut vm = Vm::new();
let obj = plain_object(&mut vm);
let session = vm.promote_object(obj);
vm.pending_length_exception = Some(JsValue::from_js_object(session));
let mut roots = Vec::new();
vm.for_each_root(|v| roots.push(v));
assert!(has_ptr(&roots, session));
}
#[test]
fn suspended_signal_fields_are_roots() {
let mut vm = Vm::new();