@@ -38,7 +38,8 @@ export function invalidate(renderer, scope, node, names, main_execution_context
3838 * @param {import('estree').Expression } [node]
3939 */
4040 function get_invalidated ( variable , node ) {
41- if ( main_execution_context && ! variable . subscribable && variable . name [ 0 ] !== '$' ) {
41+ const is_props = ! ! variable . export_name ;
42+ if ( main_execution_context && ! is_props && ! variable . subscribable && variable . name [ 0 ] !== '$' ) {
4243 return node ;
4344 }
4445 return renderer_invalidate ( renderer , variable . name , undefined , main_execution_context ) ;
@@ -61,8 +62,9 @@ export function invalidate(renderer, scope, node, names, main_execution_context
6162 return x `@set_store_value(${ head . name . slice ( 1 ) } , ${ node } , ${ head . name } , ${ extra_args } )` ;
6263 }
6364
65+ const is_props = ! ! head . export_name ;
6466 let invalidate ;
65- if ( ! main_execution_context ) {
67+ if ( ! main_execution_context || is_props ) {
6668 const pass_value =
6769 extra_args . length > 0 ||
6870 ( node . type === 'AssignmentExpression' && node . left . type !== 'Identifier' ) ||
@@ -96,8 +98,9 @@ export function invalidate(renderer, scope, node, names, main_execution_context
9698 */
9799export function renderer_invalidate ( renderer , name , value , main_execution_context = false ) {
98100 const variable = renderer . component . var_lookup . get ( name ) ;
101+ const is_props = variable && variable . export_name && ! variable . module ;
99102 if ( variable && variable . subscribable && ( variable . reassigned || variable . export_name ) ) {
100- if ( main_execution_context ) {
103+ if ( main_execution_context && ! is_props ) {
101104 return x `${ `$$subscribe_${ name } ` } (${ value || name } )` ;
102105 } else {
103106 const member = renderer . context_lookup . get ( name ) ;
@@ -124,6 +127,9 @@ export function renderer_invalidate(renderer, name, value, main_execution_contex
124127 const member = renderer . context_lookup . get ( name ) ;
125128 return x `$$invalidate(${ member . index } , ${ value } )` ;
126129 }
130+ } else if ( main_execution_context && is_props ) {
131+ const member = renderer . context_lookup . get ( name ) ;
132+ return x `$$invalidate(${ member . index } , ${ name } )` ;
127133 }
128134 if ( main_execution_context ) return ;
129135 // if this is a reactive declaration, invalidate dependencies recursively
0 commit comments