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

Method walk

lib/source-node.js:235–250  ·  view source on GitHub ↗

* Walk over the tree of JS snippets in this node and its children. The * walking function is called once for each snippet of JS and is passed that * snippet and the its original associated source's line/column location. * * @param aFn The traversal function.

(aFn)

Source from the content-addressed store, hash-verified

233 * @param aFn The traversal function.
234 */
235 walk(aFn) {
236 let chunk;
237 for (let i = 0, len = this.children.length; i < len; i++) {
238 chunk = this.children[i];
239 if (chunk[isSourceNode]) {
240 chunk.walk(aFn);
241 } else if (chunk !== "") {
242 aFn(chunk, {
243 source: this.source,
244 line: this.line,
245 column: this.column,
246 name: this.name,
247 });
248 }
249 }
250 }
251
252 /**
253 * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between

Callers 4

toStringMethod · 0.95
toStringWithSourceMapMethod · 0.95
testFunction · 0.95

Calls

no outgoing calls

Tested by 1

testFunction · 0.76