mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
fix: REPL 变量跨轮次丢失 —— let/const 脚本顶层写全局对象
This commit is contained in:
@@ -428,7 +428,7 @@ fn eval_repl(code: &str, kernel: &Arc<KernelCore>, vm: &mut Vm) -> ExitCode {
|
||||
}
|
||||
};
|
||||
|
||||
let compiler = Compiler::new();
|
||||
let compiler = Compiler::new().with_repl_persist(true);
|
||||
let hash = compiled_module_hash(&program);
|
||||
let module = match kernel.code_forge().get_or_insert_with(hash, || compiler.compile(&program)) {
|
||||
Ok(m) => m,
|
||||
|
||||
Reference in New Issue
Block a user