feat: 间接 eval 读全局词法环境镜像并补齐写路径

This commit is contained in:
2026-10-16 15:03:55 +00:00
parent 84900dc4a1
commit cf0b59d892
18 changed files with 250 additions and 31 deletions
+3
View File
@@ -530,6 +530,9 @@ impl Vm {
fn clear_full_reset_state(&mut self) {
self.clear_execution_state();
// 全局词法环境镜像随 session 隔离重建:顶层词法绑定不跨 run 存活,
// 旧镜像属性区释放并重建空对象(防上一 run 残留值被新 run 读到)。
self.realm.session.borrow_mut().clear_global_lexical();
// 模板对象缓存中的 JsValue 指向将被重建的 session 对象:全量重置后悬垂,
// 必须随 session 一并清空。
self.template_objects.clear();