builtins/vm: matchAll 编译正则载体专型标签,释放/深拷贝经 RegExp 同一守卫,止逐调用 Box 泄漏

This commit is contained in:
2026-09-13 11:05:52 +00:00
parent c564ec539b
commit 50674ee4f5
8 changed files with 123 additions and 6 deletions
+1 -1
View File
@@ -586,7 +586,7 @@ impl SessionGc {
crate::async_generator::clone_async_generator_native_with_rewrite(old_ref, new_ref, |value| value);
} else if old_ref.is_generator_obj() {
crate::generator::clone_generator_native_with_rewrite(old_ref, new_ref, |value| value);
} else if old_ref.is_regexp_obj() {
} else if old_ref.holds_compiled_regex() {
// 已编译正则是 Box 深拷贝到新对象:源 Box 由 drop 释放,互不共享。
regexp::clone_regexp_native(old_ref, new_ref);
}