constructor(options = {}) {
      const { importHook, name: compartmentName } = options

      // Compartment can be created without `importHook` or `name` but
      // @endo/compartment-mapper always provides them. This block should
      // never be reached - it's provided to avoid breaking the API if
      // the extended Compartment constructor is ever used to create a detached
      // compartment internally in compartment-mapper in the future.
      /* c8 ignore next */
      if (!importHook || !compartmentName) {
        super(options)
        return
      }

      /* c8 ignore next */
      if (!(compartmentName in compartmentMap.compartments)) {
        // We should not witness creation of compartmentswith impotHook
        // which are not present in the compartment map.
        // The only reason this doesn't throw is we're in policy generation and
        // the preferred outcome is an incomplete policy.
        // TODO: consider printing a warning
        super(options)
        return
      }

      /**
       * ImportHook which wraps the original `importHook` to potentially inject
       * names into {@link CompartmentDescriptor.modules}. The additional names
       * come from policy-overrides and supplement what @endo/compartment-mapper
       * was able to detect.
       *
       * @type {ImportHook}
       */
      const wrappedImportHook = async (specifier) => {
        const moduleDescriptor = await importHook(specifier)

        if (
          !isRecordModuleDescriptor(moduleDescriptor) &&
          !isSourceModuleDescriptor(moduleDescriptor)
        ) {
          // probably a builtin
          return moduleDescriptor
        }

        const compartmentDescriptor =
          compartmentMap.compartments[compartmentName]

        /* c8 ignore next */
        if (!compartmentDescriptor) {
          // See comment for unknown compartmentName in the constructor body.
          // Allowing a Compartment with an unknown name to work requires a
          // pass-through in this custom importHook.
          return moduleDescriptor
        }

        // Adds missing imports to the module descriptor from the
        // policy-override.
        for (const overriddenResourceName of getOverriddenResourceNames(
          compartmentDescriptor
        )) {
          // mutates `moduleDescriptor`!!
          updateModuleSource(moduleDescriptor, overriddenResourceName)
        }

        return moduleDescriptor
      }

      super({ ...options, importHook: wrappedImportHook })
    }
Wraps the `Compartment`'s `ImportHook` to potentially inject names into
its list of `ModuleDescriptor`s.

@param {CompartmentOptions} [options]