Skip to content
Permalink
Browse files
fix(runtime-core): only set cache for object keys (#6266)
  • Loading branch information
danielroe committed Aug 29, 2022
1 parent 2024d11 commit c3465c1e889651df925324ed2a10ac2d5f229110
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
@@ -7,6 +7,7 @@ import {
hyphenate,
isArray,
isFunction,
isObject,
isOn,
toNumber,
UnionToIntersection
@@ -226,7 +227,9 @@ export function normalizeEmitsOptions(
}

if (!raw && !hasExtends) {
cache.set(comp, null)
if (isObject(comp)) {
cache.set(comp, null)
}
return null
}

@@ -236,7 +239,9 @@ export function normalizeEmitsOptions(
extend(normalized, raw)
}

cache.set(comp, normalized)
if (isObject(comp)) {
cache.set(comp, normalized)
}
return normalized
}

@@ -966,8 +966,9 @@ export function resolveMergedOptions(
}
mergeOptions(resolved, base, optionMergeStrategies)
}

cache.set(base, resolved)
if (isObject(base)) {
cache.set(base, resolved)
}
return resolved
}

@@ -494,7 +494,9 @@ export function normalizePropsOptions(
}

if (!raw && !hasExtends) {
cache.set(comp, EMPTY_ARR as any)
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]
cache.set(comp, res)
if (isObject(comp)) {
cache.set(comp, res)
}
return res
}

0 comments on commit c3465c1

Please sign in to comment.