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

Method walkSourceContents

lib/source-node.js:313–324  ·  view source on GitHub ↗

* Walk over the tree of SourceNodes. The walking function is called for each * source file content and is passed the filename and source content. * * @param aFn The traversal function.

(aFn)

Source from the content-addressed store, hash-verified

311 * @param aFn The traversal function.
312 */
313 walkSourceContents(aFn) {
314 for (let i = 0, len = this.children.length; i < len; i++) {
315 if (this.children[i][isSourceNode]) {
316 this.children[i].walkSourceContents(aFn);
317 }
318 }
319
320 const sources = Object.keys(this.sourceContents);
321 for (let i = 0, len = sources.length; i < len; i++) {
322 aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
323 }
324 }
325
326 /**
327 * Return the string representation of this source node. Walks over the tree

Callers 3

toStringWithSourceMapMethod · 0.95
testFunction · 0.95

Calls

no outgoing calls

Tested by 1

testFunction · 0.76