]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
wip: cache normalized options for dev check
authorEvan You <evan@vuejs.org>
Wed, 4 Dec 2024 15:50:59 +0000 (23:50 +0800)
committerEvan You <evan@vuejs.org>
Wed, 4 Dec 2024 15:50:59 +0000 (23:50 +0800)
packages/runtime-vapor/src/component.ts

index 9564729a0b617458843a790b8f14987433aa4257..0eb7ce228f8453f9f4d4ded382e5bd7e99b81cdd 100644 (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) {