dist/watJSON.browser.js
/**
	   * An IndexedSourceMapConsumer instance represents a parsed source map which
	   * we can query for information. It differs from BasicSourceMapConsumer in
	   * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
	   * input.
	   *
	   * The only parameter is a raw source map (either as a JSON string, or already
	   * parsed to an object). According to the spec for indexed source maps, they
	   * have the following attributes:
	   *
	   *   - version: Which version of the source map spec this map is following.
	   *   - file: Optional. The generated file this source map is associated with.
	   *   - sections: A list of section definitions.
	   *
	   * Each value under the "sections" field has two fields:
	   *   - offset: The offset into the original specified at which this section
	   *       begins to apply, defined as an object with a "line" and "column"
	   *       field.
	   *   - map: A source map definition. This source map could also be indexed,
	   *       but doesn't have to be.
	   *
	   * Instead of the "map" field, it's also possible to have a "url" field
	   * specifying a URL to retrieve a source map from, but that's currently
	   * unsupported.
	   *
	   * Here's an example source map, taken from the source map spec[0], but
	   * modified to omit a section which uses the "url" field.
	   *
	   *  {
	   *    version : 3,
	   *    file: "app.js",
	   *    sections: [{
	   *      offset: {line:100, column:10},
	   *      map: {
	   *        version : 3,
	   *        file: "section.js",
	   *        sources: ["foo.js", "bar.js"],
	   *        names: ["src", "maps", "are", "fun"],
	   *        mappings: "AAAA,E;;ABCDE;"
	   *      }
	   *    }],
	   *  }
	   *
	   * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
	   */
An IndexedSourceMapConsumer instance represents a parsed source map which
we can query for information. It differs from BasicSourceMapConsumer in
that it takes "indexed" source maps  as
input.

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

- version: Which version of the source map spec this map is following.
- file: Optional. The generated file this source map is associated with.
- sections: A list of section definitions.



Instead of the "map" field, it's also possible to have a "url" field
specifying a URL to retrieve a source map from, but that's currently
unsupported.

Here's an example source map, taken from the source map spec[0], but
modified to omit a section which uses the "url" field.




An IndexedSourceMapConsumer instance represents a parsed source map which we can query for information . It differs from BasicSourceMapConsumer in that it takes " indexed " source maps as input . The only parameter is a raw source map ( either as a JSON string or already parsed to an object ) . According to the spec for indexed source maps they have the following attributes . - version : Which version of the source map spec this map is following . - file : Optional . The generated file this source map is associated with . - sections : A list of section definitions . Instead of the " map " field it ' s also possible to have a " url " field specifying a URL to retrieve a source map from but that ' s currently unsupported . Here ' s an example source map taken from the source map spec [ 0 ] but modified to omit a section which uses the " url " field .
function IndexedSourceMapConsumer(aSourceMap) {
	    var sourceMap = aSourceMap;
	    if (typeof aSourceMap === 'string') {
	      sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
	    }
	    var version = util.getArg(sourceMap, 'version');
	    var sections = util.getArg(sourceMap, 'sections');
	    if (version != this._version) {
	      throw new Error('Unsupported version: ' + version);
	    }
	    var lastOffset = {
	      line: -1,
	      column: 0
	    };
	    this._sections = sections.map(function (s) {
	      if (s.url) {
	        throw new Error('Support for url field in sections not implemented.');
	      }
	      var offset = util.getArg(s, 'offset');
	      var offsetLine = util.getArg(offset, 'line');
	      var offsetColumn = util.getArg(offset, 'column');
	      if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
	        throw new Error('Section offsets must be ordered and non-overlapping.');
	      }
	      lastOffset = offset;
	      return {
	        generatedOffset: {
	          generatedLine: offsetLine + 1,
	          generatedColumn: offsetColumn + 1
	        },
	        consumer: new SourceMapConsumer(util.getArg(s, 'map'))
	      };
	    });
	  }
function IndexedSourceMapConsumer ( aSourceMap ) { var sourceMap = aSourceMap ; if ( typeof aSourceMap === 'string' ) { sourceMap = JSON . parse ( aSourceMap . replace ( / ^\)\]\}' / , '' ) ) ; } var version = util . getArg ( sourceMap , 'version' ) ; var sections = util . getArg ( sourceMap , 'sections' ) ; if ( version != this . _version ) { throw new Error ( 'Unsupported version: ' + version ) ; } var lastOffset = { line : - 1 , column : 0 } ; this . _sections = sections . map ( function ( s ) { if ( s . url ) { throw new Error ( 'Support for url field in sections not implemented.' ) ; } var offset = util . getArg ( s , 'offset' ) ; var offsetLine = util . getArg ( offset , 'line' ) ; var offsetColumn = util . getArg ( offset , 'column' ) ; if ( offsetLine < lastOffset . line || offsetLine === lastOffset . line && offsetColumn < lastOffset . column ) { throw new Error ( 'Section offsets must be ordered and non-overlapping.' ) ; } lastOffset = offset ; return { generatedOffset : { generatedLine : offsetLine + 1 , generatedColumn : offsetColumn + 1 } , consumer : new SourceMapConsumer ( util . getArg ( s , 'map' ) ) } ; } ) ; }
An IndexedSourceMapConsumer instance represents a parsed source map which
 we can query for information.
An IndexedSourceMapConsumer instance represents a parsed source map which we can query for information .
// The url field will require support for asynchronicity. // See https://github.com/mozilla/source-map/issues/16 // The offset fields are 0-based, but we use 1-based indices when // encoding/decoding from VLQ.