pull/16641/head
Rich Harris 3 weeks ago
parent fa21f83464
commit 14a4f6c09c

@ -375,10 +375,13 @@ export function client_component(analysis, options) {
component_block.body.push(b.stmt(b.call(`$.async_body`, b.arrow([], body, true)))); component_block.body.push(b.stmt(b.call(`$.async_body`, b.arrow([], body, true))));
} else { } else {
component_block.body.push( component_block.body.push(.../** @type {ESTree.Statement[]} */ (instance.body));
.../** @type {ESTree.Statement[]} */ (instance.body),
.../** @type {ESTree.Statement[]} */ (template.body) if (!analysis.runes && analysis.needs_context) {
); component_block.body.push(b.stmt(b.call('$.init', analysis.immutable ? b.true : undefined)));
}
component_block.body.push(.../** @type {ESTree.Statement[]} */ (template.body));
} }
if (analysis.needs_mutation_validation) { if (analysis.needs_mutation_validation) {
@ -387,10 +390,6 @@ export function client_component(analysis, options) {
); );
} }
if (!analysis.runes && analysis.needs_context) {
component_block.body.push(b.stmt(b.call('$.init', analysis.immutable ? b.true : undefined)));
}
const should_inject_context = const should_inject_context =
dev || dev ||
analysis.needs_context || analysis.needs_context ||

Loading…
Cancel
Save