8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08bc87b commit eb8020aCopy full SHA for eb8020a
packages/core/data/dom-events/dom-event.ts
@@ -418,7 +418,11 @@ export class DOMEvent implements Event {
418
419
// Consistent with the original implementation, we only apply
420
// context to the function if thisArg is truthy.
421
- const returnValue = callback.apply(thisArg || undefined, [data]);
+ //
422
+ // We prefer Function.call() over Function.apply() as it avoids
423
+ // having to allocate an array just to hold the args (saves 30
424
+ // nanoseconds per dispatchTo() call).
425
+ const returnValue = callback.call(thisArg || undefined, data);
426
427
// This ensures that errors thrown inside asynchronous functions do
428
// not get swallowed.
0 commit comments