MCPcopy
hub / github.com/mozilla/source-map / sourceContentFor

Method sourceContentFor

lib/source-map-consumer.js:890–903  ·  view source on GitHub ↗

* Returns the original source content. The only argument is the url of the * original source file. Returns null if no original source content is * available.

(aSource, nullOnMissing)

Source from the content-addressed store, hash-verified

888 * available.
889 */
890 sourceContentFor(aSource, nullOnMissing) {
891 for (let i = 0; i < this._sections.length; i++) {
892 const section = this._sections[i];
893
894 const content = section.consumer.sourceContentFor(aSource, true);
895 if (content) {
896 return content;
897 }
898 }
899 if (nullOnMissing) {
900 return null;
901 }
902 throw new Error('"' + aSource + '" is not in the SourceMap.');
903 }
904
905 _findSectionIndex(source) {
906 for (let i = 0; i < this._sections.length; i++) {

Callers

nothing calls this directly

Calls 1

sourceContentForMethod · 0.65

Tested by

no test coverage detected