Skip to content

Commit

Permalink
[BUGFIX lts] Remove all own listeners
Browse files Browse the repository at this point in the history
We were previously only removing own listeners if they were functions,
this PR updates us to always remove all of them.
  • Loading branch information
Chris Garrett committed Jun 26, 2019
1 parent 8b90e83 commit a424258
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions packages/@ember/-internals/meta/lib/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -594,14 +594,9 @@ export class Meta {
} else {
let listener = listeners[i];

// If the listener is our own function listener and we are trying to
// remove it, we want to splice it out entirely so we don't hold onto a
// reference.
if (
kind === ListenerKind.REMOVE &&
listener.kind !== ListenerKind.REMOVE &&
typeof method === 'function'
) {
// If the listener is our own listener and we are trying to remove it, we
// want to splice it out entirely so we don't hold onto a reference.
if (kind === ListenerKind.REMOVE && listener.kind !== ListenerKind.REMOVE) {
listeners.splice(i, 1);
} else {
assert(
Expand Down

0 comments on commit a424258

Please sign in to comment.