* Return this construct and all of its children in the given order
(order: ConstructOrder = ConstructOrder.PREORDER)
| 195 | * Return this construct and all of its children in the given order |
| 196 | */ |
| 197 | public findAll(order: ConstructOrder = ConstructOrder.PREORDER): IConstruct[] { |
| 198 | const ret = new Array<IConstruct>(); |
| 199 | visit(this.host); |
| 200 | return ret; |
| 201 | |
| 202 | function visit(c: IConstruct) { |
| 203 | if (order === ConstructOrder.PREORDER) { |
| 204 | ret.push(c); |
| 205 | } |
| 206 | |
| 207 | for (const child of c.node.children) { |
| 208 | visit(child); |
| 209 | } |
| 210 | |
| 211 | if (order === ConstructOrder.POSTORDER) { |
| 212 | ret.push(c); |
| 213 | } |
| 214 | } |
| 215 | } |
| 216 | |
| 217 | /** |
| 218 | * This can be used to set contextual values. |
no outgoing calls
no test coverage detected