refactor: 拆分 Kernel 中可变 Session 与不可变 Core

This commit is contained in:
2026-06-14 12:58:09 +08:00
parent 1730236eb1
commit 246ad72540
63 changed files with 666 additions and 615 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ fn new_map_inner() -> *mut indexmap::IndexMap<SetKey, JsValue> {
}
fn alloc_map(vm: &mut Vm) -> *mut JsObject {
let map_proto = vm.kernel().builtin_world().map_proto.as_ptr() as *mut JsObject;
let map_proto = vm.session().builtin_world().map_proto.as_ptr() as *mut JsObject;
let mut obj = JsObject::new_empty(EMPTY_SHAPE_ID, JsValue::from_js_object(map_proto));
obj.set_map(true);
// SAFETY: new_map_inner() returns a valid Box<IndexMap> pointer; stored as a JsValue