@@ -393,6 +393,17 @@ export class DOMEvent implements Event {
393
393
for ( let i = this . listenersLazyCopy . length - 1 ; i >= 0 ; i -- ) {
394
394
const listener = this . listenersLazyCopy [ i ] ;
395
395
396
+ // Assigning variables this old-fashioned way is up to 50
397
+ // nanoseconds faster per run than ESM destructuring syntax.
398
+ const capture = listener . capture ;
399
+
400
+ // Handle only the events appropriate to the phase. Global events
401
+ // (a NativeScript-only concept) are allowed to be handled
402
+ // regardless of phase, for backwards-compatibility.
403
+ if ( ! isGlobal && ( ( phase === DOMEvent . CAPTURING_PHASE && ! capture ) || ( phase === DOMEvent . BUBBLING_PHASE && capture ) ) ) {
404
+ continue ;
405
+ }
406
+
396
407
// The event listener may have been removed since we took a copy of
397
408
// the array, so bail out if so.
398
409
//
@@ -410,17 +421,6 @@ export class DOMEvent implements Event {
410
421
continue ;
411
422
}
412
423
413
- // Assigning variables this old-fashioned way is up to 50
414
- // nanoseconds faster per run than ESM destructuring syntax.
415
- const capture = listener . capture ;
416
-
417
- // Handle only the events appropriate to the phase. Global events
418
- // (a NativeScript-only concept) are allowed to be handled
419
- // regardless of phase, for backwards-compatibility.
420
- if ( ! isGlobal && ( ( phase === DOMEvent . CAPTURING_PHASE && ! capture ) || ( phase === DOMEvent . BUBBLING_PHASE && capture ) ) ) {
421
- continue ;
422
- }
423
-
424
424
const callback = listener . callback ;
425
425
const thisArg = listener . thisArg ;
426
426
0 commit comments