Home / Function/ LabeledStatement() — svelte Function Reference

LabeledStatement() — svelte Function Reference

Architecture documentation for the LabeledStatement() function in LabeledStatement.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  f07cc5e4_200c_22ec_a3a3_a7fe94d45deb["LabeledStatement()"]
  c7316a07_c84a_9be5_364a_b6dae10c1c63["LabeledStatement.js"]
  f07cc5e4_200c_22ec_a3a3_a7fe94d45deb -->|defined in| c7316a07_c84a_9be5_364a_b6dae10c1c63
  style f07cc5e4_200c_22ec_a3a3_a7fe94d45deb fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/phases/3-transform/server/visitors/LabeledStatement.js lines 9–24

export function LabeledStatement(node, context) {
	if (context.state.analysis.runes || context.path.length > 1 || node.label.name !== '$') {
		return;
	}

	// TODO bail out if we're in module context

	// these statements will be topologically ordered later
	context.state.legacy_reactive_statements.set(
		node,
		// people could do "break $" inside, so we need to keep the label
		b.labeled('$', /** @type {ExpressionStatement} */ (context.visit(node.body)))
	);

	return b.empty;
}

Domain

Subdomains

Frequently Asked Questions

What does LabeledStatement() do?
LabeledStatement() is a function in the svelte codebase, defined in packages/svelte/src/compiler/phases/3-transform/server/visitors/LabeledStatement.js.
Where is LabeledStatement() defined?
LabeledStatement() is defined in packages/svelte/src/compiler/phases/3-transform/server/visitors/LabeledStatement.js at line 9.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free