|
|
@ -364,6 +364,12 @@ export function client_component(analysis, options) {
|
|
|
|
: b.stmt(b.call('$.init', analysis.immutable ? b.true : undefined))
|
|
|
|
: b.stmt(b.call('$.init', analysis.immutable ? b.true : undefined))
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (analysis.needs_mutation_validation) {
|
|
|
|
|
|
|
|
component_block.body.unshift(
|
|
|
|
|
|
|
|
b.var('$$ownership_validator', b.call('$.create_ownership_validator', b.id('$$props')))
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const should_inject_context =
|
|
|
|
const should_inject_context =
|
|
|
|
dev ||
|
|
|
|
dev ||
|
|
|
|
analysis.needs_context ||
|
|
|
|
analysis.needs_context ||
|
|
|
@ -434,12 +440,6 @@ export function client_component(analysis, options) {
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (analysis.needs_mutation_validation) {
|
|
|
|
|
|
|
|
component_block.body.unshift(
|
|
|
|
|
|
|
|
b.var('$$ownership_validator', b.call('$.create_ownership_validator', b.id('$$props')))
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// we want the cleanup function for the stores to run as the very last thing
|
|
|
|
// we want the cleanup function for the stores to run as the very last thing
|
|
|
|
// so that it can effectively clean up the store subscription even after the user effects runs
|
|
|
|
// so that it can effectively clean up the store subscription even after the user effects runs
|
|
|
|
if (should_inject_context) {
|
|
|
|
if (should_inject_context) {
|
|
|
|