// is the multiple hasOwn() calls. It's much faster to do a simple property
// access on a plain object, so we use an accessCache object (with null
// prototype) to memoize what access type a key corresponds to.
+ let normalizedProps
if (key[0] !== '$') {
const n = accessCache![key]
if (n !== undefined) {
} else if (
// only cache other properties when instance has declared (thus stable)
// props
- type.props &&
- hasOwn(normalizePropsOptions(type)[0]!, key)
+ (normalizedProps = normalizePropsOptions(type)[0]) &&
+ hasOwn(normalizedProps, key)
) {
accessCache![key] = AccessTypes.PROPS
return props![key]
}: ComponentRenderContext,
key: string
) {
+ let normalizedProps
return (
accessCache![key] !== undefined ||
(data !== EMPTY_OBJ && hasOwn(data, key)) ||
(setupState !== EMPTY_OBJ && hasOwn(setupState, key)) ||
- (type.props && hasOwn(normalizePropsOptions(type)[0]!, key)) ||
+ ((normalizedProps = normalizePropsOptions(type)[0]) &&
+ hasOwn(normalizedProps, key)) ||
hasOwn(ctx, key) ||
hasOwn(publicPropertiesMap, key) ||
hasOwn(appContext.config.globalProperties, key)