mirror of
https://github.com/voltrevo/ValueScript.git
synced 2026-04-18 03:00:27 -04:00
Replace run with runLinked, allow modules that don't export functions
This commit is contained in:
@@ -22,4 +22,4 @@ mod vs_pointer;
|
||||
mod vs_value;
|
||||
|
||||
pub use virtual_machine::VirtualMachine;
|
||||
pub use vs_value::ValTrait;
|
||||
pub use vs_value::{LoadFunctionResult, ValTrait};
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user