Skip to content

Commit 38a3a5a

Browse files
pkozlowski-opensourceIgorMinar
authored andcommitted
refactor(ivy): remove unused code related to listeners clanup (angular#29725)
PR Close angular#29725
1 parent 902a53a commit 38a3a5a

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

packages/core/src/render3/interfaces/view.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -539,11 +539,6 @@ export interface TView {
539539
* `useCaptureOrIndx >= 0` `removeListener = LView[CLEANUP][useCaptureOrIndx]`
540540
* `useCaptureOrIndx < 0` `subscription = LView[CLEANUP][-useCaptureOrIndx]`
541541
*
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-
*
547542
* If it's an output subscription or query list destroy hook:
548543
* 1st index is: output unsubscribe function / query list destroy function
549544
* 2nd index is: index of function context in LView.cleanupInstances[]

packages/core/src/render3/node_manipulation.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -488,15 +488,15 @@ function removeListeners(lView: LView): void {
488488
const lCleanup = lView[CLEANUP] !;
489489
for (let i = 0; i < tCleanup.length - 1; i += 2) {
490490
if (typeof tCleanup[i] === 'string') {
491-
// This is a listener with the native renderer
491+
// This is a native DOM listener
492492
const idxOrTargetGetter = tCleanup[i + 1];
493493
const target = typeof idxOrTargetGetter === 'function' ?
494494
idxOrTargetGetter(lView) :
495495
unwrapRNode(lView[idxOrTargetGetter]);
496496
const listener = lCleanup[tCleanup[i + 2]];
497497
const useCaptureOrSubIdx = tCleanup[i + 3];
498498
if (typeof useCaptureOrSubIdx === 'boolean') {
499-
// DOM listener
499+
// native DOM listener registered with Renderer3
500500
target.removeEventListener(tCleanup[i], listener, useCaptureOrSubIdx);
501501
} else {
502502
if (useCaptureOrSubIdx >= 0) {
@@ -508,10 +508,6 @@ function removeListeners(lView: LView): void {
508508
}
509509
}
510510
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();
515511
} else {
516512
// This is a cleanup function that is grouped with the index of its context
517513
const context = lCleanup[tCleanup[i + 1]];

0 commit comments

Comments
 (0)