constructor(aSourceMap, aSourceMapURL) {
    return super(INTERNAL).then((that) => {
      let sourceMap = aSourceMap;
      if (typeof aSourceMap === 'string') {
        sourceMap = util.parseSourceMapInput(aSourceMap);
      }

      const version = util.getArg(sourceMap, 'version');
      let sources = util.getArg(sourceMap, 'sources');
      // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
      // requires the array) to play nice here.
      const names = util.getArg(sourceMap, 'names', []);
      let sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
      const sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
      const mappings = util.getArg(sourceMap, 'mappings');
      const file = util.getArg(sourceMap, 'file', null);

      // Once again, Sass deviates from the spec and supplies the version as a
      // string rather than a number, so we use loose equality checking here.
      if (version != that._version) {
        throw new Error('Unsupported version: ' + version)
      }

      if (sourceRoot) {
        sourceRoot = util.normalize(sourceRoot);
      }

      sources = sources
        .map(String)
        // Some source maps produce relative source paths like "./foo.js" instead of
        // "foo.js".  Normalize these first so that future comparisons will succeed.
        // See bugzil.la/1090768.
        .map(util.normalize)
        // Always ensure that absolute sources are internally stored relative to
        // the source root, if the source root is absolute. Not doing this would
        // be particularly problematic when the source root is a prefix of the
        // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
        .map(function (source) {
          return sourceRoot &&
            util.isAbsolute(sourceRoot) &&
            util.isAbsolute(source)
            ? util.relative(sourceRoot, source)
            : source
        });

      // Pass `true` below to allow duplicate names and sources. While source maps
      // are intended to be compressed and deduplicated, the TypeScript compiler
      // sometimes generates source maps with duplicates in them. See Github issue
      // #72 and bugzil.la/889492.
      that._names = ArraySet.fromArray(names.map(String), true);
      that._sources = ArraySet.fromArray(sources, true);

      that._absoluteSources = that._sources.toArray().map(function (s) {
        return util.computeSourceURL(sourceRoot, s, aSourceMapURL)
      });

      that.sourceRoot = sourceRoot;
      that.sourcesContent = sourcesContent;
      that._mappings = mappings;
      that._sourceMapURL = aSourceMapURL;
      that.file = file;

      that._computedColumnSpans = false;
      that._mappingsPtr = 0;
      that._wasm = null;

      return wasm().then((w) => {
        that._wasm = w;
        return that
      })
    })
  }
A BasicSourceMapConsumer instance represents a parsed source map which we can
query for information about the original file positions by giving it a file
position in the generated source.

The first parameter is the raw source map (either as a JSON string, or
already parsed to an object). According to the spec, source maps have the
following attributes:

  - version: Which version of the source map spec this map is following.
  - sources: An array of URLs to the original source files.
  - names: An array of identifiers which can be referenced by individual mappings.
  - sourceRoot: Optional. The URL root from which all sources are relative.
  - sourcesContent: Optional. An array of contents of the original source files.
  - mappings: A string of base64 VLQs which contain the actual mappings.
  - file: Optional. The generated file this source map is associated with.

Here is an example source map, taken from the source map spec[0]:

    {
      version : 3,
      file: "out.js",
      sourceRoot : "",
      sources: ["foo.js", "bar.js"],
      names: ["src", "maps", "are", "fun"],
      mappings: "AA,AB;;ABCDE;"
    }

The second parameter, if given, is a string whose value is the URL
at which the source map was found.  This URL is used to compute the
sources array.

[0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#