* Simulates the traversal of a two-phase, capture/bubble event dispatch.
(inst, fn, arg)
| 2575 | * Simulates the traversal of a two-phase, capture/bubble event dispatch. |
| 2576 | */ |
| 2577 | function traverseTwoPhase(inst, fn, arg) { |
| 2578 | var path = []; |
| 2579 | while (inst) { |
| 2580 | path.push(inst); |
| 2581 | inst = getParent(inst); |
| 2582 | } |
| 2583 | var i = void 0; |
| 2584 | for (i = path.length; i-- > 0;) { |
| 2585 | fn(path[i], 'captured', arg); |
| 2586 | } |
| 2587 | for (i = 0; i < path.length; i++) { |
| 2588 | fn(path[i], 'bubbled', arg); |
| 2589 | } |
| 2590 | } |
| 2591 | |
| 2592 | /** |
| 2593 | * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that |
no test coverage detected