fix: 修复闭包值传递链路

This commit is contained in:
爱特每羊队
2026-06-30 22:52:25 +08:00
parent a6168c8a57
commit a17f98b02d
5 changed files with 34 additions and 10 deletions
+2
View File
@@ -152,6 +152,8 @@ impl Vm {
pub fn run(&mut self, module: &CompiledModule) -> Result<JsValue, String> {
vm_debug!("run: starting bytecode execution, {} instructions", module.bytecode.len());
self.clear_execution_state();
self.cell_stack.clear();
self.cell_stack.push(Vec::new());
self.sub_modules = Arc::new(module.sub_modules.clone());
self.immutables_cache = (0..=self.sub_modules.len()).map(|_| OnceLock::new()).collect();
self.bytecode = module.bytecode.clone();