constructor(dependencies, moduleResolver = new PathModuleResolver()) {
    /** @const {!Map<string, !Dependency>} */
    this.depsBySymbol = new Map();
    /** @const {!Map<string, !Dependency>} */
    this.depsByPath = new Map();
    /** @const */
    this.moduleResolver = moduleResolver;

    for (const dep of dependencies) {
      if (this.depsByPath.has(dep.path)) {
        throw new Error('File registered twice? ' + dep.path);
      }
      this.depsByPath.set(dep.path, dep);
      // Keep both OS-dependent path and POSIX style path.
      this.depsByPath.set(normalizePath(dep.path), dep);
      for (const sym of dep.closureSymbols) {
        const previous = this.depsBySymbol.get(sym);
        if (previous) {
          throw new SourceError(
              `The symbol "${sym}" has already been defined at ` +
                  previous.path,
              dep.path);
        }
        this.depsBySymbol.set(sym, dep);
      }
    }
  }
@param {!Array<!Dependency>} dependencies
@param {!ModuleResolver=} moduleResolver