wip: cache normalized options for dev check

This commit is contained in:
Evan You 2024-12-04 23:50:59 +08:00
parent caca46bb73
commit 004e23f9dd
No known key found for this signature in database
GPG Key ID: 00E9AB7A6704CE0A
1 changed files with 7 additions and 1 deletions

View File

@ -24,7 +24,7 @@ import {
} from './componentProps'
import { setDynamicProp } from './dom/prop'
import { renderEffect } from './renderEffect'
import { emit } from './componentEmits'
import { emit, normalizeEmitsOptions } from './componentEmits'
export type VaporComponent = FunctionalVaporComponent | ObjectVaporComponent
@ -209,6 +209,12 @@ export class VaporComponentInstance implements GenericComponentInstance {
this.props = comp.props ? new Proxy(target, handlers[0]!) : {}
this.attrs = new Proxy(target, handlers[1])
if (__DEV__) {
// cache normalized options for dev only emit check
this.propsOptions = normalizePropsOptions(comp)
this.emitsOptions = normalizeEmitsOptions(comp)
}
// determine fallthrough
this.hasFallthrough = false
if (rawProps) {