Replace run with runLinked, allow modules that don't export functions

This commit is contained in:
Andrew Morris
2023-03-28 16:56:01 +11:00
parent c199d3bb8e
commit 8d7fe133f3
6 changed files with 36 additions and 93 deletions

View File

@@ -97,4 +97,13 @@ impl VirtualMachine {
Err(exception)
}
pub fn read_default_export(bytecode: &Rc<Vec<u8>>) -> Val {
let mut bd = BytecodeDecoder {
data: bytecode.clone(),
pos: 0,
};
bd.decode_val(&Vec::new())
}
}