]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor: make sure setupContext.emit always reference current emit on instance
authorEvan You <yyx990803@gmail.com>
Mon, 13 Apr 2020 14:06:41 +0000 (10:06 -0400)
committerEvan You <yyx990803@gmail.com>
Mon, 13 Apr 2020 14:06:51 +0000 (10:06 -0400)
This is dev only and for internal use by vue-test-utils.

packages/runtime-core/src/component.ts

index e9d34da54b26da91d413050bf7d6f34cf1b32784..50c4496612c7346dc1129716ef839f251803f9aa 100644 (file)
@@ -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 {