This commit is contained in:
Quaternions 2024-09-18 18:48:39 -07:00
parent aa361bce77
commit baea9e297c

View File

@ -18,13 +18,17 @@ pub mod data{
pub struct Dom(rbx_dom_weak::WeakDom); pub struct Dom(rbx_dom_weak::WeakDom);
impl Dom{ impl Dom{
pub fn run_scripts(&mut self){ pub fn run_scripts(self)->Self{
let mut context=roblox_emulator::context::Context::new(&mut self.0); let runner=roblox_emulator::runner::Runner::new().unwrap();
let mut context=roblox_emulator::context::Context::new(self.0);
for script in context.scripts(){ for script in context.scripts(){
if let Err(e)=script.run(&mut context){ let (modified_context,script_error)=runner.run_script(script,context);
context=modified_context;
if let Err(e)=script_error{
e.print(); e.print();
} }
} }
Self(context.into_inner())
} }
} }