@@ -38,7 +38,8 @@ export function invalidate(renderer, scope, node, names, main_execution_context
38
38
* @param {import('estree').Expression } [node]
39
39
*/
40
40
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 ] !== '$' ) {
42
43
return node ;
43
44
}
44
45
return renderer_invalidate ( renderer , variable . name , undefined , main_execution_context ) ;
@@ -61,8 +62,9 @@ export function invalidate(renderer, scope, node, names, main_execution_context
61
62
return x `@set_store_value(${ head . name . slice ( 1 ) } , ${ node } , ${ head . name } , ${ extra_args } )` ;
62
63
}
63
64
65
+ const is_props = ! ! head . export_name ;
64
66
let invalidate ;
65
- if ( ! main_execution_context ) {
67
+ if ( ! main_execution_context || is_props ) {
66
68
const pass_value =
67
69
extra_args . length > 0 ||
68
70
( node . type === 'AssignmentExpression' && node . left . type !== 'Identifier' ) ||
@@ -96,8 +98,9 @@ export function invalidate(renderer, scope, node, names, main_execution_context
96
98
*/
97
99
export function renderer_invalidate ( renderer , name , value , main_execution_context = false ) {
98
100
const variable = renderer . component . var_lookup . get ( name ) ;
101
+ const is_props = variable && variable . export_name && ! variable . module ;
99
102
if ( variable && variable . subscribable && ( variable . reassigned || variable . export_name ) ) {
100
- if ( main_execution_context ) {
103
+ if ( main_execution_context && ! is_props ) {
101
104
return x `${ `$$subscribe_${ name } ` } (${ value || name } )` ;
102
105
} else {
103
106
const member = renderer . context_lookup . get ( name ) ;
@@ -124,6 +127,9 @@ export function renderer_invalidate(renderer, name, value, main_execution_contex
124
127
const member = renderer . context_lookup . get ( name ) ;
125
128
return x `$$invalidate(${ member . index } , ${ value } )` ;
126
129
}
130
+ } else if ( main_execution_context && is_props ) {
131
+ const member = renderer . context_lookup . get ( name ) ;
132
+ return x `$$invalidate(${ member . index } , ${ name } )` ;
127
133
}
128
134
if ( main_execution_context ) return ;
129
135
// if this is a reactive declaration, invalidate dependencies recursively
0 commit comments