@@ -249,29 +249,6 @@ export function spread_props(...props) {
249249 return new Proxy ( { props } , spread_props_handler ) ;
250250}
251251
252- /**
253- * @template T
254- * @param {() => T } fn
255- * @returns {T }
256- */
257- function with_parent_tracking_context ( fn ) {
258- var effect = active_effect ;
259- var previous_effect = active_effect ;
260- var previous_reaction = active_reaction ;
261-
262- while ( effect !== null && ( effect . f & ( BRANCH_EFFECT | ROOT_EFFECT ) ) === 0 ) {
263- effect = effect . parent ;
264- }
265- try {
266- set_active_effect ( effect ) ;
267- set_active_reaction ( effect ) ;
268- return fn ( ) ;
269- } finally {
270- set_active_effect ( previous_effect ) ;
271- set_active_reaction ( previous_reaction ) ;
272- }
273- }
274-
275252/**
276253 * This function is responsible for synchronizing a possibly bound prop with the inner component state.
277254 * It is used whenever the compiler sees that the component writes to the prop, or when it has a default prop_value.
@@ -290,13 +267,11 @@ export function prop(props, key, flags, fallback) {
290267 var is_store_sub = false ;
291268 var prop_value ;
292269
293- with_parent_tracking_context ( ( ) => {
294- if ( bindable ) {
295- [ prop_value , is_store_sub ] = capture_store_binding ( ( ) => /** @type {V } */ ( props [ key ] ) ) ;
296- } else {
297- prop_value = /** @type {V } */ ( props [ key ] ) ;
298- }
299- } ) ;
270+ if ( bindable ) {
271+ [ prop_value , is_store_sub ] = capture_store_binding ( ( ) => /** @type {V } */ ( props [ key ] ) ) ;
272+ } else {
273+ prop_value = /** @type {V } */ ( props [ key ] ) ;
274+ }
300275
301276 // Can be the case when someone does `mount(Component, props)` with `let props = $state({...})`
302277 // or `createClassComponent(Component, props)`
@@ -331,7 +306,7 @@ export function prop(props, key, flags, fallback) {
331306 e . props_invalid_value ( key ) ;
332307 }
333308
334- prop_value = with_parent_tracking_context ( get_fallback ) ;
309+ prop_value = get_fallback ( ) ;
335310 if ( setter ) setter ( prop_value ) ;
336311 }
337312
0 commit comments