From: Evan You Date: Mon, 10 Feb 2020 02:47:16 +0000 (-0500) Subject: refactor: ensure setup context.emit always point to intenral emit X-Git-Tag: v3.0.0-alpha.5~67 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e308ad99e9f5bdfb0910a2d6959e746f558714c5;p=thirdparty%2Fvuejs%2Fcore.git refactor: ensure setup context.emit always point to intenral emit --- diff --git a/packages/runtime-core/src/component.ts b/packages/runtime-core/src/component.ts index a615e8fad9..3081ecad26 100644 --- a/packages/runtime-core/src/component.ts +++ b/packages/runtime-core/src/component.ts @@ -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 }