]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor: ensure setup context.emit always point to intenral emit
authorEvan You <yyx990803@gmail.com>
Mon, 10 Feb 2020 02:47:16 +0000 (21:47 -0500)
committerEvan You <yyx990803@gmail.com>
Mon, 10 Feb 2020 02:47:16 +0000 (21:47 -0500)
packages/runtime-core/src/component.ts

index a615e8fad9d78838169436964fbed0e7a0f0cba3..3081ecad2642a01d05c3ba440d9ea6f581c6263e 100644 (file)
@@ -493,7 +493,9 @@ function createSetupContext(instance: ComponentInternalInstance): SetupContext {
     // need to expose them through a proxy
     attrs: new Proxy(instance, SetupProxyHandlers.attrs),
     slots: new Proxy(instance, SetupProxyHandlers.slots),
-    emit: instance.emit
+    get emit() {
+      return instance.emit
+    }
   }
   return __DEV__ ? Object.freeze(context) : context
 }