44 getOwner ,
55 setOwner ,
66} from '@ember/-internals/owner' ;
7- import { enumerableSymbol , guidFor } from '@ember/-internals/utils' ;
7+ import { guidFor } from '@ember/-internals/utils' ;
88import { addChildView , setElementView , setViewElement } from '@ember/-internals/views' ;
99import type { Nullable } from '@ember/-internals/utility-types' ;
1010import { assert , debugFreeze } from '@ember/debug' ;
@@ -53,8 +53,13 @@ import {
5353import ComponentStateBucket from '../utils/curly-component-state-bucket' ;
5454import { processComponentArgs } from '../utils/process-args' ;
5555
56- export const ARGS = enumerableSymbol ( 'ARGS' ) ;
57- export const HAS_BLOCK = enumerableSymbol ( 'HAS_BLOCK' ) ;
56+ const COMPONENT_ARGS_MAP = new WeakMap < object , CapturedArguments [ 'named' ] > ( ) ;
57+
58+ export function getComponentCapturedArgs (
59+ component : object
60+ ) : CapturedArguments [ 'named' ] | undefined {
61+ return COMPONENT_ARGS_MAP . get ( component ) ;
62+ }
5863
5964export const DIRTY_TAG = Symbol ( 'DIRTY_TAG' ) ;
6065export const IS_DISPATCHING_ATTRS = Symbol ( 'IS_DISPATCHING_ATTRS' ) ;
@@ -248,8 +253,7 @@ export default class CurlyComponentManager
248253 args : VMArguments ,
249254 { isInteractive } : Environment ,
250255 dynamicScope : DynamicScope ,
251- callerSelfRef : Reference ,
252- hasBlock : boolean
256+ callerSelfRef : Reference
253257 ) : ComponentStateBucket {
254258 // Get the nearest concrete component instance from the scope. "Virtual"
255259 // components will be skipped.
@@ -261,7 +265,6 @@ export default class CurlyComponentManager
261265
262266 beginTrackFrame ( ) ;
263267 let props = processComponentArgs ( capturedArgs ) ;
264- props [ ARGS ] = capturedArgs ;
265268 let argsTag = endTrackFrame ( ) ;
266269
267270 // Alias `id` argument to `elementId` property on the component instance.
@@ -271,11 +274,6 @@ export default class CurlyComponentManager
271274 // component.
272275 props . parentView = parentView ;
273276
274- // Set whether this component was invoked with a block
275- // (`{{#my-component}}{{/my-component}}`) or without one
276- // (`{{my-component}}`).
277- props [ HAS_BLOCK ] = hasBlock ;
278-
279277 // Save the current `this` context of the template as the component's
280278 // `_target`, so bubbled actions are routed to the right place.
281279 props . _target = valueForRef ( callerSelfRef ) ;
@@ -293,6 +291,10 @@ export default class CurlyComponentManager
293291 beginUntrackFrame ( ) ;
294292 let component = ComponentClass . create ( props ) ;
295293
294+ // Store capturedArgs in a WeakMap keyed by the component instance so that
295+ // PROPERTY_DID_CHANGE can look them up
296+ COMPONENT_ARGS_MAP . set ( component , capturedArgs ) ;
297+
296298 let finalizer = _instrumentStart ( 'render.component' , initialRenderInstrumentDetails , component ) ;
297299
298300 // We become the new parentView for downstream components, so save our
0 commit comments