File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
packages/svelte/src/compiler/phases/3-transform/client Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -393,6 +393,12 @@ export function client_component(analysis, options) {
393393 ) ;
394394 }
395395
396+ if ( analysis . needs_mutation_validation ) {
397+ component_block . body . unshift (
398+ b . var ( '$$ownership_validator' , b . call ( '$.create_ownership_validator' , b . id ( '$$props' ) ) )
399+ ) ;
400+ }
401+
396402 const should_inject_context =
397403 dev ||
398404 analysis . needs_context ||
@@ -402,12 +408,6 @@ export function client_component(analysis, options) {
402408 // we want the cleanup function for the stores to run as the very last thing
403409 // so that it can effectively clean up the store subscription even after the user effects runs
404410 if ( should_inject_context ) {
405- if ( analysis . needs_mutation_validation ) {
406- component_block . body . unshift (
407- b . var ( '$$ownership_validator' , b . call ( '$.create_ownership_validator' , b . id ( '$$props' ) ) )
408- ) ;
409- }
410-
411411 component_block . body . unshift ( b . stmt ( b . call ( '$.push' , ...push_args ) ) ) ;
412412
413413 let to_push ;
You can’t perform that action at this time.
0 commit comments