fix(runtime-core): only set cache for object keys (#6266)
This commit is contained in:
parent
2024d11db0
commit
c3465c1e88
@ -7,6 +7,7 @@ import {
|
||||
hyphenate,
|
||||
isArray,
|
||||
isFunction,
|
||||
isObject,
|
||||
isOn,
|
||||
toNumber,
|
||||
UnionToIntersection
|
||||
@ -226,7 +227,9 @@ export function normalizeEmitsOptions(
|
||||
}
|
||||
|
||||
if (!raw && !hasExtends) {
|
||||
if (isObject(comp)) {
|
||||
cache.set(comp, null)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
@ -236,7 +239,9 @@ export function normalizeEmitsOptions(
|
||||
extend(normalized, raw)
|
||||
}
|
||||
|
||||
if (isObject(comp)) {
|
||||
cache.set(comp, normalized)
|
||||
}
|
||||
return normalized
|
||||
}
|
||||
|
||||
|
@ -966,8 +966,9 @@ export function resolveMergedOptions(
|
||||
}
|
||||
mergeOptions(resolved, base, optionMergeStrategies)
|
||||
}
|
||||
|
||||
if (isObject(base)) {
|
||||
cache.set(base, resolved)
|
||||
}
|
||||
return resolved
|
||||
}
|
||||
|
||||
|
@ -494,7 +494,9 @@ export function normalizePropsOptions(
|
||||
}
|
||||
|
||||
if (!raw && !hasExtends) {
|
||||
if (isObject(comp)) {
|
||||
cache.set(comp, EMPTY_ARR as any)
|
||||
}
|
||||
return EMPTY_ARR as any
|
||||
}
|
||||
|
||||
@ -534,7 +536,9 @@ export function normalizePropsOptions(
|
||||
}
|
||||
|
||||
const res: NormalizedPropsOptions = [normalized, needCastKeys]
|
||||
if (isObject(comp)) {
|
||||
cache.set(comp, res)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user