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> {
let context = Context::new(None)?;
let mut global = context.global()?;
attach_db_obj(&context, &mut global, db)?;
let mut runner = Self::init()?;
runner.call_attacher(|c, o| attach_db_obj(c, o, db))??;
context.add_callback("print", |a: String| {
print(a);
None::<bool>
})?;
Ok(Runner {
context: Arc::new(Mutex::new(context)),
})
Ok(runner)
}
pub fn call_attacher<F, R>(&mut self, f: F) -> ScriptResult<R>