| 9153 | // However, any method that operates the module system will throw an exception |
| 9154 | // if these hooks are not available. |
| 9155 | const assertModuleHooks= (compartment)=>{ |
| 9156 | const { importHook, resolveHook}= weakmapGet(privateFields, compartment); |
| 9157 | if( typeof importHook!== 'function'|| typeof resolveHook!== 'function') { |
| 9158 | throw TypeError( |
| 9159 | 'Compartment must be constructed with an importHook and a resolveHook for it to be able to load modules'); |
| 9160 | |
| 9161 | } |
| 9162 | }; |
| 9163 | |
| 9164 | const InertCompartment= function Compartment( |
| 9165 | _endowments= {}, |