From 5968cff3a8acc82657cd051c504265835eaac7a2 Mon Sep 17 00:00:00 2001 From: Evan You Date: Mon, 13 Apr 2020 10:06:41 -0400 Subject: [PATCH] refactor: make sure setupContext.emit always reference current emit on instance This is dev only and for internal use by vue-test-utils. --- packages/runtime-core/src/component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime-core/src/component.ts b/packages/runtime-core/src/component.ts index e9d34da5..50c44966 100644 --- a/packages/runtime-core/src/component.ts +++ b/packages/runtime-core/src/component.ts @@ -517,7 +517,7 @@ function createSetupContext(instance: ComponentInternalInstance): SetupContext { return new Proxy(instance.slots, slotsHandlers) }, get emit() { - return instance.emit + return (event: string, ...args: any[]) => instance.emit(event, ...args) } }) } else {