Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions packages/runtime-core/src/componentEmits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
hyphenate,
isArray,
isFunction,
isObject,
isOn,
toNumber,
UnionToIntersection
Expand Down Expand Up @@ -226,7 +227,9 @@ export function normalizeEmitsOptions(
}

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

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

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

Expand Down
5 changes: 3 additions & 2 deletions packages/runtime-core/src/componentOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -966,8 +966,9 @@ export function resolveMergedOptions(
}
mergeOptions(resolved, base, optionMergeStrategies)
}

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

Expand Down
8 changes: 6 additions & 2 deletions packages/runtime-core/src/componentProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down