@@ -231,6 +231,15 @@ export default class AwaitBlockWrapper extends Wrapper {
231231
232232 const dependencies = this . node . expression . dynamic_dependencies ( ) ;
233233
234+ let update_child_context ;
235+ if ( this . then . value && this . catch . value ) {
236+ update_child_context = b `#child_ctx[${ this . then . value_index } ] = #child_ctx[${ this . catch . value_index } ] = ${ info } .resolved;` ;
237+ } else if ( this . then . value ) {
238+ update_child_context = b `#child_ctx[${ this . then . value_index } ] = ${ info } .resolved;` ;
239+ } else if ( this . catch . value ) {
240+ update_child_context = b `#child_ctx[${ this . catch . value_index } ] = ${ info } .resolved;` ;
241+ }
242+
234243 if ( dependencies . length > 0 ) {
235244 const condition = x `
236245 ${ block . renderer . dirty ( dependencies ) } &&
@@ -247,7 +256,7 @@ export default class AwaitBlockWrapper extends Wrapper {
247256
248257 } else {
249258 const #child_ctx = #ctx.slice();
250- ${ this . then . value && b `#child_ctx[ ${ this . then . value_index } ] = ${ info } .resolved;` }
259+ ${ update_child_context }
251260 ${ info } .block.p(#child_ctx, #dirty);
252261 }
253262 ` ) ;
@@ -261,7 +270,7 @@ export default class AwaitBlockWrapper extends Wrapper {
261270 block . chunks . update . push ( b `
262271 {
263272 const #child_ctx = #ctx.slice();
264- ${ this . then . value && b `#child_ctx[ ${ this . then . value_index } ] = ${ info } .resolved;` }
273+ ${ update_child_context }
265274 ${ info } .block.p(#child_ctx, #dirty);
266275 }
267276 ` ) ;
0 commit comments