|
|
@@ -328,11 +328,8 @@ export function normalizePropsOptions(
|
|
|
appContext: AppContext,
|
|
|
asMixin = false
|
|
|
): NormalizedPropsOptions {
|
|
|
- const appId = appContext.app ? appContext.app._uid : -1
|
|
|
- const cache = comp.__props || (comp.__props = {})
|
|
|
- const cached = cache[appId]
|
|
|
- if (cached) {
|
|
|
- return cached
|
|
|
+ if (!appContext.deopt && comp.__props) {
|
|
|
+ return comp.__props
|
|
|
}
|
|
|
|
|
|
const raw = comp.props
|
|
|
@@ -360,7 +357,7 @@ export function normalizePropsOptions(
|
|
|
}
|
|
|
|
|
|
if (!raw && !hasExtends) {
|
|
|
- return (cache[appId] = EMPTY_ARR)
|
|
|
+ return (comp.__props = EMPTY_ARR)
|
|
|
}
|
|
|
|
|
|
if (isArray(raw)) {
|
|
|
@@ -398,7 +395,16 @@ export function normalizePropsOptions(
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- return (cache[appId] = [normalized, needCastKeys])
|
|
|
+ return (comp.__props = [normalized, needCastKeys])
|
|
|
+}
|
|
|
+
|
|
|
+function validatePropName(key: string) {
|
|
|
+ if (key[0] !== '$') {
|
|
|
+ return true
|
|
|
+ } else if (__DEV__) {
|
|
|
+ warn(`Invalid prop name: "${key}" is a reserved property.`)
|
|
|
+ }
|
|
|
+ return false
|
|
|
}
|
|
|
|
|
|
// use function string name to check type constructors
|
|
|
@@ -441,18 +447,6 @@ function validateProps(props: Data, instance: ComponentInternalInstance) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * dev only
|
|
|
- */
|
|
|
-function validatePropName(key: string) {
|
|
|
- if (key[0] !== '$') {
|
|
|
- return true
|
|
|
- } else if (__DEV__) {
|
|
|
- warn(`Invalid prop name: "${key}" is a reserved property.`)
|
|
|
- }
|
|
|
- return false
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* dev only
|
|
|
*/
|