Skip to content

Commit a1c24dd

Browse files
committed
mark reactive declarations dependencies as mutated if the declaration is mutated
1 parent e89137b commit a1c24dd

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/compiler/compile/Component.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,19 +1174,16 @@ export default class Component {
11741174
const map = this.instance_scope_map;
11751175

11761176
const assignee_stack: Array<{
1177-
has_reassigned_assignee: boolean,
11781177
has_mutated_assignee: boolean,
11791178
}> = [];
11801179

11811180
const new_assignee_stack = () => assignee_stack.push({
11821181
has_mutated_assignee: false,
1183-
has_reassigned_assignee: false
11841182
});
11851183

11861184
const update_assignee_stack = (name) => {
11871185
const variable = component.var_lookup.get(name);
11881186
if (variable) {
1189-
if (variable.reassigned) assignee_stack[assignee_stack.length - 1].has_reassigned_assignee = true;
11901187
if (variable.mutated) assignee_stack[assignee_stack.length - 1].has_mutated_assignee = true;
11911188
}
11921189
};
@@ -1226,8 +1223,7 @@ export default class Component {
12261223
const variable = component.var_lookup.get(name);
12271224
if (variable) variable.is_reactive_dependency = true;
12281225

1229-
if (variable && owner === component.instance_scope) {
1230-
if (assignee_stack[assignee_stack.length - 1].has_reassigned_assignee) variable.reassigned = true;
1226+
if (variable && owner === component.instance_scope && assignee_stack.length) {
12311227
if (assignee_stack[assignee_stack.length - 1].has_mutated_assignee) variable.mutated = true;
12321228
}
12331229

0 commit comments

Comments
 (0)