Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/svelte/src/compiler/phases/2-analyze/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ export function analyze_component(root, source, options) {
binding.declaration_kind !== 'import'
) {
binding.kind = 'state';
binding.mutated = binding.updated = true;
binding.mutated = true;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function ExportSpecifier(node, context) {
});

const binding = context.state.scope.get(local_name);
if (binding) binding.reassigned = binding.updated = true;
if (binding) binding.reassigned = true;
}
} else {
validate_export(node, context.state.scope, local_name);
Expand Down
7 changes: 4 additions & 3 deletions packages/svelte/src/compiler/phases/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ export class Binding {
is_called = false;
mutated = false;
reassigned = false;
updated = false;

/**
*
Expand All @@ -77,6 +76,10 @@ export class Binding {
this.kind = kind;
this.declaration_kind = declaration_kind;
}

get updated() {
return this.mutated || this.reassigned;
}
}

export class Scope {
Expand Down Expand Up @@ -738,8 +741,6 @@ export function create_scopes(ast, root, allow_reactive_declarations, parent) {
const binding = left && scope.get(left.name);

if (binding !== null && left !== binding.node) {
binding.updated = true;

if (left === expression) {
binding.reassigned = true;
} else {
Expand Down