* 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)
| 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 |
no outgoing calls