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
10 changes: 9 additions & 1 deletion packages/svelte/src/compiler/phases/2-analyze/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,15 @@ function calculate_blockers(instance, scopes, analysis) {
trace_references(body, reads_writes, reads_writes);

const max = [...reads_writes].reduce((max, binding) => {
return binding.blocker ? Math.max(binding.blocker.property.value, max) : max;
if (binding.blocker) {
let property = /** @type {ESTree.SimpleLiteral & { value: number }} */ (
binding.blocker.property
);

return Math.max(property.value, max);
}

return max;
}, -1);

if (max === -1) continue;
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte/src/compiler/phases/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export class Binding {
* otherwise the initial value will not have been assigned.
* It is a member expression of the form `$$blockers[n]`.
* TODO the blocker is set during transform which feels a bit grubby
* @type {MemberExpression & { object: Identifier, property: SimpleLiteral & { value: number } } | null}
* @type {MemberExpression | null}
*/
blocker = null;

Expand Down
Loading