fix: convert property bag to args

This commit is contained in:
shirakaba
2022-12-21 10:40:25 +09:00
parent 253d313776
commit 1f3a62c3fb
5 changed files with 44 additions and 194 deletions

View File

@@ -290,7 +290,9 @@ export class DOMEvent implements Event {
* event's cancelable attribute value is false or its preventDefault()
* method was not invoked, and false otherwise.
*/
dispatchTo({ target, data, getGlobalEventHandlersPreHandling, getGlobalEventHandlersPostHandling }: { target: Observable; data: EventData; getGlobalEventHandlersPreHandling?: () => MutationSensitiveArray<ListenerEntry>; getGlobalEventHandlersPostHandling?: () => MutationSensitiveArray<ListenerEntry> }): boolean {
// Taking multiple params rather than a single property bag saves about 100
// nanoseconds per call.
dispatchTo(target: Observable, data: EventData, getGlobalEventHandlersPreHandling?: () => MutationSensitiveArray<ListenerEntry>, getGlobalEventHandlersPostHandling?: () => MutationSensitiveArray<ListenerEntry>): boolean {
if (this.eventPhase !== DOMEvent.NONE) {
throw new Error('Tried to dispatch a dispatching event');
}