Commit Graph

1 Commits

Author SHA1 Message Date
David Wendt 19219ad0c1 avm2: Implement `dispatchEvent`.
Event dispatch is a surprisingly complicated procedure, so this makes sure to test:

1. Event dispatch on bare dispatchers
2. Event dispatch on hierarchial dispatchers (movieclips)
3. Event cancellation (which is reported by `dispatchEvent`)
4. The implicit `this` on unbound event handlers. I'm not yet sure if this is a special property of event dispatch or if all unbound functions inherit their global scope as `this`.
5. The execution order of handlers on both bare and hierarchial dispatchers
6. Delegation to hierarchial dispatchers
7. Modification of the dispatch list during dispatch of an event. Surprisingly enough, you can add handlers to the event you're handling and expect them to execute, *if* you added them to a further object in the order *or* you added a bubble handler in the capture phase.
2020-12-21 21:47:29 -08:00