(&self, name: &InternedString)
| 121 | } |
| 122 | |
| 123 | fn find_module_file(&self, name: &InternedString) -> Result<PathBuf, VmError> { |
| 124 | let module_name = name.to_str().unwrap(); |
| 125 | let file_name = format!("{}.ai", module_name); |
| 126 | |
| 127 | for search_path in &self.search_paths { |
| 128 | let full_path = search_path.join(&file_name); |
| 129 | if full_path.exists() { |
| 130 | return Ok(full_path); |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | Err(VmError::RuntimeError(format!( |
| 135 | "Could not find module '{}'.", |
| 136 | module_name |
| 137 | ))) |
| 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.") { |
no test coverage detected