Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulBGD committed Jun 16, 2017
1 parent 30d855b commit d44436c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/generators/dom/visitors/IfBlock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,14 @@ function compound(
`);
}

block.builders.destroy.addLine(
block.builders.unmount.addLine(
`${if_name}{
${name}.unmount();
}`
);

block.builders.destroy.addLine(
`${if_name}{
${name}.destroy();
}`
);
Expand Down
4 changes: 3 additions & 1 deletion test/js/samples/if-block-no-update/expected-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,14 @@ function create_main_fragment ( state, component ) {
},

unmount: function () {
{
if_block.unmount();
}
detachNode( if_block_anchor );
},

destroy: function () {
{
if_block.unmount();
if_block.destroy();
}
}
Expand Down
6 changes: 4 additions & 2 deletions test/js/samples/if-block-no-update/expected.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ function create_main_fragment ( state, component ) {
},

unmount: function () {
{
if_block.unmount();
}
detachNode( if_block_anchor );
},

destroy: function () {
{
if_block.unmount();
if_block.destroy();
}
}
Expand Down Expand Up @@ -116,4 +118,4 @@ SvelteComponent.prototype.teardown = SvelteComponent.prototype.destroy = functio
this._torndown = true;
};

export default SvelteComponent;
export default SvelteComponent;
1 change: 1 addition & 0 deletions tmp/svelte-bench
Submodule svelte-bench added at aba0da

0 comments on commit d44436c

Please sign in to comment.