wip: compat test coverage
This commit is contained in:
@@ -113,7 +113,7 @@ export function compatH(
|
||||
): VNode
|
||||
export function compatH(
|
||||
type: string | Component,
|
||||
props?: LegacyVNodeProps,
|
||||
props?: Data & LegacyVNodeProps,
|
||||
children?: LegacyVNodeChildren
|
||||
): VNode
|
||||
|
||||
@@ -190,16 +190,12 @@ function convertLegacyProps(
|
||||
} else if (key === 'on' || key === 'nativeOn') {
|
||||
const listeners = legacyProps[key]
|
||||
for (const event in listeners) {
|
||||
const handlerKey = convertLegacyEventKey(event)
|
||||
let handlerKey = convertLegacyEventKey(event)
|
||||
if (key === 'nativeOn') handlerKey += `Native`
|
||||
const existing = converted[handlerKey]
|
||||
const incoming = listeners[event]
|
||||
if (existing !== incoming) {
|
||||
if (existing) {
|
||||
// for the rare case where the same handler is attached
|
||||
// twice with/without .native modifier...
|
||||
if (key === 'nativeOn' && String(existing) === String(incoming)) {
|
||||
continue
|
||||
}
|
||||
converted[handlerKey] = [].concat(existing as any, incoming as any)
|
||||
} else {
|
||||
converted[handlerKey] = incoming
|
||||
@@ -307,6 +303,7 @@ function convertLegacySlots(vnode: VNode): VNode {
|
||||
}
|
||||
|
||||
export function defineLegacyVNodeProperties(vnode: VNode) {
|
||||
/* istanbul ignore if */
|
||||
if (
|
||||
isCompatEnabled(
|
||||
DeprecationTypes.RENDER_FUNCTION,
|
||||
|
||||
Reference in New Issue
Block a user