Skip to content

Commit

Permalink
Merge pull request #16923 from pzuraq/fix-remove-listener2
Browse files Browse the repository at this point in the history
[BUGFIX beta] ES6 classes on/removeListener and observes/removeObserver interop v2
  • Loading branch information
rwjblue authored Oct 19, 2018
2 parents d600a1d + 506b884 commit fa91986
Show file tree
Hide file tree
Showing 11 changed files with 611 additions and 162 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,13 @@ moduleFor(
['@test should be able to render an unbound helper invocation for helpers with dependent keys']() {
this.registerHelper('capitalizeName', {
destroy() {
this.removeObserver('value.firstName');
this.removeObserver('value.firstName', this, this.recompute);
this._super(...arguments);
},

compute([value]) {
if (this.get('value')) {
this.removeObserver('value.firstName');
this.removeObserver('value.firstName', this, this.recompute);
}
this.set('value', value);
this.addObserver('value.firstName', this, this.recompute);
Expand All @@ -382,8 +382,8 @@ moduleFor(
this._super(...arguments);
},
teardown() {
this.removeObserver('value.firstName');
this.removeObserver('value.lastName');
this.removeObserver('value.firstName', this, this.recompute);
this.removeObserver('value.lastName', this, this.recompute);
},
compute([value]) {
if (this.get('value')) {
Expand Down Expand Up @@ -478,13 +478,13 @@ moduleFor(
['@test should be able to render an unbound helper invocation with bound hash options']() {
this.registerHelper('capitalizeName', {
destroy() {
this.removeObserver('value.firstName');
this.removeObserver('value.firstName', this, this.recompute);
this._super(...arguments);
},

compute([value]) {
if (this.get('value')) {
this.removeObserver('value.firstName');
this.removeObserver('value.firstName', this, this.recompute);
}
this.set('value', value);
this.addObserver('value.firstName', this, this.recompute);
Expand All @@ -498,8 +498,8 @@ moduleFor(
this._super(...arguments);
},
teardown() {
this.removeObserver('value.firstName');
this.removeObserver('value.lastName');
this.removeObserver('value.firstName', this, this.recompute);
this.removeObserver('value.lastName', this, this.recompute);
},
compute([value]) {
if (this.get('value')) {
Expand Down
Loading

0 comments on commit fa91986

Please sign in to comment.