[oden][oden-js] Rework modules

Damn this is a lot
This commit is contained in:
John Doty 2023-06-24 08:45:39 -07:00
parent aa90cea4a3
commit db8a5f8eed
12 changed files with 280 additions and 105 deletions

View file

@ -30,17 +30,17 @@ impl ScriptContext {
let js = include_str!("main.js");
let module = context
.load_module(js, "main.js")
.eval_module(js, "main.js")
.expect("Unable to load main");
let init = module
.get_module_export(&context, "init")
.get_export(&context, "init")
.expect("Unable to fetch init");
let update = module
.get_module_export(&context, "update")
.get_export(&context, "update")
.expect("Unable to fetch update");
let draw = module
.get_module_export(&context, "draw")
.get_export(&context, "draw")
.expect("Unable to fetch draw");
ScriptContext {