| 138 | } |
| 139 | |
| 140 | pub fn register_native_module(&mut self, name: InternedString<'gc>, module: ModuleKind<'gc>) { |
| 141 | if !name.to_str().unwrap().starts_with("std.") { |
| 142 | panic!("Native modules must have names starting with 'std.'"); |
| 143 | } |
| 144 | #[cfg(feature = "debug")] |
| 145 | println!("Registering native module {}", module.debug_info()); |
| 146 | self.modules.insert(name, module); |
| 147 | } |
| 148 | |
| 149 | pub fn register_script_module(&mut self, name: InternedString<'gc>, module: ModuleKind<'gc>) { |
| 150 | if name.to_str().unwrap().starts_with("std.") { |