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