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
3 changes: 0 additions & 3 deletions packages/svelte/src/compiler/phases/2-analyze/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ export function analyze_module(source, options) {
has_props_rune: false,
options: /** @type {ValidatedCompileOptions} */ (options),
fragment: null,
title: null,
parent_element: null,
reactive_statement: null
},
Expand Down Expand Up @@ -694,7 +693,6 @@ export function analyze_component(root, source, options) {
options,
ast_type: ast === instance.ast ? 'instance' : ast === template.ast ? 'template' : 'module',
fragment: ast === template.ast ? ast : null,
title: null,
parent_element: null,
has_props_rune: false,
component_slots: new Set(),
Expand Down Expand Up @@ -761,7 +759,6 @@ export function analyze_component(root, source, options) {
analysis,
options,
fragment: ast === template.ast ? ast : null,
title: null,
parent_element: null,
has_props_rune: false,
ast_type: ast === instance.ast ? 'instance' : ast === template.ast ? 'template' : 'module',
Expand Down
1 change: 0 additions & 1 deletion packages/svelte/src/compiler/phases/2-analyze/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export interface AnalysisState {
options: ValidatedCompileOptions;
ast_type: 'instance' | 'template' | 'module';
fragment: AST.Fragment | null;
title: AST.TitleElement | null;
/**
* Tag name of the parent element. `null` if the parent is `svelte:element`, `#snippet`, a component or the root.
* Parent doesn't necessarily mean direct path predecessor because there could be `#each`, `#if` etc in-between.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ export function AwaitExpression(node, context) {
suspend = true;
}

if (context.state.title) {
context.state.title.metadata.has_await = true;
}

// disallow top-level `await` or `await` in template expressions
// unless a) in runes mode and b) opted into `experimental.async`
if (suspend) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export function TitleElement(node, context) {
}
}

context.visit(node.fragment, { ...context.state, title: node });
context.visit(node.fragment);
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ export function TitleElement(node, context) {
template.push(b.literal('</title>'));

context.state.init.push(
b.stmt(
b.call(
'$.build_title',
b.id('$$payload'),
b.thunk(b.block(build_template(template)), node.metadata.has_await)
)
)
b.stmt(b.call('$.build_title', b.id('$$payload'), b.thunk(b.block(build_template(template)))))
);
}
4 changes: 0 additions & 4 deletions packages/svelte/src/compiler/types/template.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,6 @@ export namespace AST {
export interface TitleElement extends BaseElement {
type: 'TitleElement';
name: 'title';
/** @internal */
metadata: {
has_await: boolean;
};
}

export interface SlotElement extends BaseElement {
Expand Down
Loading