File tree Expand file tree Collapse file tree 2 files changed +2
-11
lines changed
packages/core/src/render3 Expand file tree Collapse file tree 2 files changed +2
-11
lines changed Original file line number Diff line number Diff line change @@ -539,11 +539,6 @@ export interface TView {
539
539
* `useCaptureOrIndx >= 0` `removeListener = LView[CLEANUP][useCaptureOrIndx]`
540
540
* `useCaptureOrIndx < 0` `subscription = LView[CLEANUP][-useCaptureOrIndx]`
541
541
*
542
- * If it's a renderer2 style listener or ViewRef destroy hook being stored:
543
- * 1st index is: index of the cleanup function in LView.cleanupInstances[]
544
- * 2nd index is: `null`
545
- * `lView[CLEANUP][tView.cleanup[i+0]]()`
546
- *
547
542
* If it's an output subscription or query list destroy hook:
548
543
* 1st index is: output unsubscribe function / query list destroy function
549
544
* 2nd index is: index of function context in LView.cleanupInstances[]
Original file line number Diff line number Diff line change @@ -488,15 +488,15 @@ function removeListeners(lView: LView): void {
488
488
const lCleanup = lView [ CLEANUP ] ! ;
489
489
for ( let i = 0 ; i < tCleanup . length - 1 ; i += 2 ) {
490
490
if ( typeof tCleanup [ i ] === 'string' ) {
491
- // This is a listener with the native renderer
491
+ // This is a native DOM listener
492
492
const idxOrTargetGetter = tCleanup [ i + 1 ] ;
493
493
const target = typeof idxOrTargetGetter === 'function' ?
494
494
idxOrTargetGetter ( lView ) :
495
495
unwrapRNode ( lView [ idxOrTargetGetter ] ) ;
496
496
const listener = lCleanup [ tCleanup [ i + 2 ] ] ;
497
497
const useCaptureOrSubIdx = tCleanup [ i + 3 ] ;
498
498
if ( typeof useCaptureOrSubIdx === 'boolean' ) {
499
- // DOM listener
499
+ // native DOM listener registered with Renderer3
500
500
target . removeEventListener ( tCleanup [ i ] , listener , useCaptureOrSubIdx ) ;
501
501
} else {
502
502
if ( useCaptureOrSubIdx >= 0 ) {
@@ -508,10 +508,6 @@ function removeListeners(lView: LView): void {
508
508
}
509
509
}
510
510
i += 2 ;
511
- } else if ( typeof tCleanup [ i ] === 'number' ) {
512
- // This is a listener with renderer2 (cleanup fn can be found by index)
513
- const cleanupFn = lCleanup [ tCleanup [ i ] ] ;
514
- cleanupFn ( ) ;
515
511
} else {
516
512
// This is a cleanup function that is grouped with the index of its context
517
513
const context = lCleanup [ tCleanup [ i + 1 ] ] ;
You can’t perform that action at this time.
0 commit comments