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
7 changes: 2 additions & 5 deletions packages/svelte/src/compiler/phases/2-analyze/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,7 @@ export function analyze_module(ast, options) {
has_props_rune: false,
options: /** @type {ValidatedCompileOptions} */ (options),
parent_element: null,
reactive_statement: null,
reactive_statements: new Map()
reactive_statement: null
},
visitors
);
Expand Down Expand Up @@ -619,8 +618,7 @@ export function analyze_component(root, source, options) {
expression: null,
derived_state: [],
function_depth: scope.function_depth,
reactive_statement: null,
reactive_statements: new Map()
reactive_statement: null
};

walk(/** @type {AST.SvelteNode} */ (ast), state, visitors);
Expand Down Expand Up @@ -683,7 +681,6 @@ export function analyze_component(root, source, options) {
has_props_rune: false,
ast_type: ast === instance.ast ? 'instance' : ast === template.ast ? 'template' : 'module',
reactive_statement: null,
reactive_statements: analysis.reactive_statements,
component_slots: new Set(),
expression: null,
derived_state: [],
Expand Down
2 changes: 0 additions & 2 deletions packages/svelte/src/compiler/phases/2-analyze/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { Scope } from '../scope.js';
import type { ComponentAnalysis, ReactiveStatement } from '../types.js';
import type { AST, ExpressionMetadata, ValidatedCompileOptions } from '#compiler';
import type { LabeledStatement } from 'estree';

export interface AnalysisState {
scope: Scope;
Expand All @@ -24,7 +23,6 @@ export interface AnalysisState {

// legacy stuff
reactive_statement: null | ReactiveStatement;
reactive_statements: Map<LabeledStatement, ReactiveStatement>;
}

export type Context<State extends AnalysisState = AnalysisState> = import('zimmerframe').Context<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function LabeledStatement(node, context) {
}
}

context.state.reactive_statements.set(node, reactive_statement);
context.state.analysis.reactive_statements.set(node, reactive_statement);

if (
node.body.type === 'ExpressionStatement' &&
Expand Down