* Simulates the traversal of a two-phase, capture/bubble event dispatch.
(inst, fn, arg)
| 33283 | * Simulates the traversal of a two-phase, capture/bubble event dispatch. |
| 33284 | */ |
| 33285 | function traverseTwoPhase(inst, fn, arg) { |
| 33286 | var path = []; |
| 33287 | while (inst) { |
| 33288 | path.push(inst); |
| 33289 | inst = inst._hostParent; |
| 33290 | } |
| 33291 | var i; |
| 33292 | for (i = path.length; i-- > 0;) { |
| 33293 | fn(path[i], 'captured', arg); |
| 33294 | } |
| 33295 | for (i = 0; i < path.length; i++) { |
| 33296 | fn(path[i], 'bubbled', arg); |
| 33297 | } |
| 33298 | } |
| 33299 | |
| 33300 | /** |
| 33301 | * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that |