File tree Expand file tree Collapse file tree
packages/@ember/-internals/glimmer/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -56,6 +56,16 @@ import { processComponentArgs } from '../utils/process-args';
5656export const ARGS = Symbol ( 'ARGS' ) ;
5757export const HAS_BLOCK = Symbol ( 'HAS_BLOCK' ) ;
5858
59+ // WeakMap to store capturedArgs for each component instance, avoiding
60+ // symbol-keyed properties on the instance itself.
61+ const COMPONENT_ARGS_MAP = new WeakMap < object , CapturedArguments [ 'named' ] > ( ) ;
62+
63+ export function getComponentCapturedArgs (
64+ component : object
65+ ) : CapturedArguments [ 'named' ] | undefined {
66+ return COMPONENT_ARGS_MAP . get ( component ) ;
67+ }
68+
5969export const DIRTY_TAG = Symbol ( 'DIRTY_TAG' ) ;
6070export const IS_DISPATCHING_ATTRS = Symbol ( 'IS_DISPATCHING_ATTRS' ) ;
6171export const BOUNDS = Symbol ( 'BOUNDS' ) ;
@@ -286,6 +296,11 @@ export default class CurlyComponentManager
286296 beginUntrackFrame ( ) ;
287297 let component = ComponentClass . create ( props ) ;
288298
299+ // Store capturedArgs in a WeakMap keyed by the component instance so that
300+ // PROPERTY_DID_CHANGE can look them up without requiring symbol-keyed
301+ // properties on the instance.
302+ COMPONENT_ARGS_MAP . set ( component , capturedArgs ) ;
303+
289304 let finalizer = _instrumentStart ( 'render.component' , initialRenderInstrumentDetails , component ) ;
290305
291306 // We become the new parentView for downstream components, so save our
Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ import type { DirtyableTag } from '@glimmer/validator';
2828import { createTag , dirtyTag } from '@glimmer/validator' ;
2929import type { SimpleElement } from '@simple-dom/interface' ;
3030import {
31- ARGS ,
3231 BOUNDS ,
3332 CURLY_COMPONENT_MANAGER ,
3433 DIRTY_TAG ,
3534 IS_DISPATCHING_ATTRS ,
35+ getComponentCapturedArgs ,
3636} from './component-managers/curly' ;
3737import { hasDOM } from '@ember/-internals/browser-environment' ;
3838
@@ -1038,7 +1038,7 @@ class Component<S = unknown>
10381038 return ;
10391039 }
10401040
1041- let args = ( this as any ) [ ARGS ] ;
1041+ let args = getComponentCapturedArgs ( this ) ;
10421042 let reference = args !== undefined ? args [ key ] : undefined ;
10431043
10441044 if ( reference !== undefined && isUpdatableRef ( reference ) ) {
You can’t perform that action at this time.
0 commit comments