dev #25

Merged
akulij merged 38 commits from dev into main 2025-06-18 17:10:44 +00:00
Showing only changes of commit 3dbfbe48ce - Show all commits

View File

@ -1015,19 +1015,10 @@ impl Runner {
} }
pub fn init_with_db(db: &mut DB) -> ScriptResult<Self> { pub fn init_with_db(db: &mut DB) -> ScriptResult<Self> {
let context = Context::new(None)?; let mut runner = Self::init()?;
let mut global = context.global()?; runner.call_attacher(|c, o| attach_db_obj(c, o, db))??;
attach_db_obj(&context, &mut global, db)?;
context.add_callback("print", |a: String| { Ok(runner)
print(a);
None::<bool>
})?;
Ok(Runner {
context: Arc::new(Mutex::new(context)),
})
} }
pub fn call_attacher<F, R>(&mut self, f: F) -> ScriptResult<R> pub fn call_attacher<F, R>(&mut self, f: F) -> ScriptResult<R>