migration to JS engine #1

Merged
akulij merged 131 commits from dev into main 2025-05-31 08:49:52 +00:00
Showing only changes of commit c2e02efc47 - Show all commits

View File

@ -20,6 +20,13 @@ pub type ScriptResult<T> = Result<T, ScriptError>;
#[derive(Serialize, Deserialize, Debug, Clone)] #[derive(Serialize, Deserialize, Debug, Clone)]
pub struct BotFunction(String); // temporal workaround pub struct BotFunction(String); // temporal workaround
impl BotFunction {
pub fn call_context(&self, runner: &Runner) -> ScriptResult<JsValue> {
let func_name = &self.0;
runner.run_script(&format!("{func_name}()"))
}
}
// TODO: remove this function since it is suitable only for early development // TODO: remove this function since it is suitable only for early development
#[allow(clippy::print_stdout)] #[allow(clippy::print_stdout)]
fn print(s: String) { fn print(s: String) {