(self, spec: &str, bindings: Vec<NativeBinding>)
| 51 | } |
| 52 | |
| 53 | pub fn with_native(self, spec: &str, bindings: Vec<NativeBinding>) -> Self { |
| 54 | // Partition by export-name convention, mirroring the real WASM host resolver. |
| 55 | let (bindings, classes, consts) = partition_bindings(bindings); |
| 56 | self.state.borrow_mut().modules.insert( |
| 57 | spec.to_string(), |
| 58 | Resolved::Native { bindings, classes, consts, canonical: spec.to_string() }, |
| 59 | ); |
| 60 | self |
| 61 | } |
| 62 | |
| 63 | pub fn with_code(self, spec: &str, src: &str) -> Self { |
| 64 | self.state.borrow_mut().modules.insert( |
no test coverage detected