@@ -430,7 +430,6 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
430
430
// is the multiple hasOwn() calls. It's much faster to do a simple property
431
431
// access on a plain object, so we use an accessCache object (with null
432
432
// prototype) to memoize what access type a key corresponds to.
433
- let normalizedProps
434
433
if ( key [ 0 ] !== '$' ) {
435
434
const n = accessCache ! [ key ]
436
435
if ( n !== undefined ) {
@@ -451,12 +450,7 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
451
450
} else if ( data !== EMPTY_OBJ && hasOwn ( data , key ) ) {
452
451
accessCache ! [ key ] = AccessTypes . DATA
453
452
return data [ key ]
454
- } else if (
455
- // only cache other properties when instance has declared (thus stable)
456
- // props
457
- ( normalizedProps = instance . propsOptions [ 0 ] ) &&
458
- hasOwn ( normalizedProps , key )
459
- ) {
453
+ } else if ( hasOwn ( props , key ) ) {
460
454
accessCache ! [ key ] = AccessTypes . PROPS
461
455
return props ! [ key ]
462
456
} else if ( ctx !== EMPTY_OBJ && hasOwn ( ctx , key ) ) {
@@ -575,16 +569,15 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
575
569
576
570
has (
577
571
{
578
- _ : { data, setupState, accessCache, ctx, appContext, propsOptions } ,
572
+ _ : { data, setupState, accessCache, ctx, appContext, props } ,
579
573
} : ComponentRenderContext ,
580
574
key : string ,
581
575
) {
582
- let normalizedProps
583
576
return (
584
577
! ! accessCache ! [ key ] ||
585
578
( data !== EMPTY_OBJ && hasOwn ( data , key ) ) ||
586
579
hasSetupBinding ( setupState , key ) ||
587
- ( ( normalizedProps = propsOptions [ 0 ] ) && hasOwn ( normalizedProps , key ) ) ||
580
+ hasOwn ( props , key ) ||
588
581
hasOwn ( ctx , key ) ||
589
582
hasOwn ( publicPropertiesMap , key ) ||
590
583
hasOwn ( appContext . config . globalProperties , key )
0 commit comments