diff --git a/src/compile/render-dom/wrappers/AwaitBlock.ts b/src/compile/render-dom/wrappers/AwaitBlock.ts index ca1fdcc64e..cbc03f8ce9 100644 --- a/src/compile/render-dom/wrappers/AwaitBlock.ts +++ b/src/compile/render-dom/wrappers/AwaitBlock.ts @@ -80,7 +80,7 @@ export default class AwaitBlockWrapper extends Wrapper { status, renderer, block, - parent, + this, child, stripWhitespace, nextSibling diff --git a/test/runtime/samples/await-containing-if/_config.js b/test/runtime/samples/await-containing-if/_config.js new file mode 100644 index 0000000000..9e24e4f614 --- /dev/null +++ b/test/runtime/samples/await-containing-if/_config.js @@ -0,0 +1,35 @@ +let fulfil; + +let thePromise = new Promise(f => { + fulfil = f; +}); + +export default { + props: { + thePromise, + show: true + }, + + html: ` +

loading...

+ `, + + test({ assert, component, target }) { + fulfil(42); + + return thePromise + .then(() => { + assert.htmlEqual(target.innerHTML, ` +

the value is 42

+ `); + + component.show = false; + assert.htmlEqual(target.innerHTML, `
`); + + component.show = true; + assert.htmlEqual(target.innerHTML, ` +

the value is 42

+ `); + }); + } +}; \ No newline at end of file diff --git a/test/runtime/samples/await-containing-if/main.html b/test/runtime/samples/await-containing-if/main.html new file mode 100644 index 0000000000..cab07e6499 --- /dev/null +++ b/test/runtime/samples/await-containing-if/main.html @@ -0,0 +1,11 @@ +
+ {#await thePromise} +

loading...

+ {:then theValue} + {#if show} +

the value is {theValue}

+ {/if} + {:catch theError} +

oh no! {theError.message}

+ {/await} +
\ No newline at end of file