Skip to content

Commit

Permalink
Merge pull request #14281 from rwjblue/fix-release-regressions
Browse files Browse the repository at this point in the history
Fix release regressions.
  • Loading branch information
rwjblue authored Sep 13, 2016
2 parents 143342f + d62be7a commit e0f87ed
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2540,4 +2540,44 @@ moduleFor('Components test: curly components', class extends RenderingTest {

this.assert.ok(true, 'no errors during teardown');
}

['@test setting a property in willDestroyElement does not assert (GH#14273)'](assert) {
assert.expect(2);

this.registerComponent('foo-bar', {
ComponentClass: Component.extend({
init() {
this._super(...arguments);
this.showFoo = true;
},

willDestroyElement() {
run(() => this.set('showFoo', false));
assert.ok(true, 'willDestroyElement was fired');
this._super(...arguments);
}
}),

template: `{{#if showFoo}}things{{/if}}`
});

this.render(`{{foo-bar}}`);

this.assertText('things');
}

['@test using parentView in the template does not error during destruction']() {
this.registerComponent('foo-bar', {
ComponentClass: Component.extend({
title: computed('parentView.title', function() {
return this.get('parentView.title');
})
}),
template: `{{title}}`
});

this.render(`{{foo-bar}}`, { title: 'things' });

this.assertText('things');
}
});
1 change: 0 additions & 1 deletion packages/ember-htmlbars/lib/hooks/cleanup-render-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export default function cleanupRenderNode(renderNode) {
if (view.parentView && view.parentView === env.view) {
view.parentView.removeChild(view);
}
view.parentView = null;

view._transitionTo('preRender');
});
Expand Down
4 changes: 4 additions & 0 deletions packages/ember-views/lib/mixins/view_support.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,10 @@ export default Mixin.create({
},

scheduleRevalidate(node, label, manualRerender) {
if (this.isDestroying) {
return;
}

if (node && !this._dispatching && this._env.renderedNodes.has(node)) {
if (manualRerender) {
deprecate(
Expand Down

0 comments on commit e0f87ed

Please sign in to comment.