Home / Function/ template.AwaitBlock() — svelte Function Reference

template.AwaitBlock() — svelte Function Reference

Architecture documentation for the template.AwaitBlock() function in index.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  d85ffc67_41c3_6b80_47f7_1c9403063163["template.AwaitBlock()"]
  cab41022_1b55_3b7a_06c6_b90763bbea47["index.js"]
  d85ffc67_41c3_6b80_47f7_1c9403063163 -->|defined in| cab41022_1b55_3b7a_06c6_b90763bbea47
  fd9e1483_8d98_1d09_da34_84b84cb1e057["trim_block()"]
  d85ffc67_41c3_6b80_47f7_1c9403063163 -->|calls| fd9e1483_8d98_1d09_da34_84b84cb1e057
  style d85ffc67_41c3_6b80_47f7_1c9403063163 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/migrate/index.js lines 1387–1406

	AwaitBlock(node, { state, next }) {
		const start = node.start;
		const end =
			state.str.original.indexOf(
				'}',
				node.pending !== null ? node.expression.end : node.value?.end
			) + 1;
		trim_block(state, start, end);
		if (node.pending !== null) {
			const start = state.str.original.lastIndexOf('{', node.value?.start);
			const end = state.str.original.indexOf('}', node.value?.end) + 1;
			trim_block(state, start, end);
		}
		if (node.catch !== null) {
			const start = state.str.original.lastIndexOf('{', node.error?.start);
			const end = state.str.original.indexOf('}', node.error?.end) + 1;
			trim_block(state, start, end);
		}
		next();
	},

Domain

Subdomains

Calls

Frequently Asked Questions

What does template.AwaitBlock() do?
template.AwaitBlock() is a function in the svelte codebase, defined in packages/svelte/src/compiler/migrate/index.js.
Where is template.AwaitBlock() defined?
template.AwaitBlock() is defined in packages/svelte/src/compiler/migrate/index.js at line 1387.
What does template.AwaitBlock() call?
template.AwaitBlock() calls 1 function(s): trim_block.

Analyze Your Own Codebase

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

Try Supermodel Free