(&mut self, name: InternedString<'gc>, module: ModuleKind<'gc>)
| 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.") { |
| 151 | panic!("Script modules cannot have names starting with 'std.'"); |
| 152 | } |
| 153 | #[cfg(feature = "debug")] |
| 154 | println!("Registering script module {}", module.debug_info()); |
| 155 | self.modules.insert(name, module); |
| 156 | } |
| 157 | |
| 158 | pub fn get_module(&self, name: InternedString<'gc>) -> Option<&ModuleKind<'gc>> { |
| 159 | self.modules.get(&name) |