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 bf032e6ce4 - Show all commits

View File

@ -77,6 +77,16 @@ mod tests {
println!("Val: {:?}", val.to_string());
}
#[test]
fn test_deserialization_main() {
let runner = Runner::init().unwrap();
let val = runner.run_script(include_str!("../mainbot.js")).unwrap();
let s: RunnerConfig = from_js(unsafe { runner.context.context_raw() }, &val).unwrap();
println!("deser: {:#?}", s);
let o = val.try_into_object().unwrap();
println!("o: {:?}", recursive_format(o));
}
fn recursive_format(o: OwnedJsObject) -> String {
let props: Vec<_> = o.properties_iter().unwrap().map(|x| x.unwrap()).collect();
let sp: Vec<String> = props