From 02e225a73a0768dceaffa52ea45b7eeeaafc68e6 Mon Sep 17 00:00:00 2001 From: Tan Li Hau Date: Sun, 6 Oct 2019 13:55:16 +0800 Subject: [PATCH] should throw error if createEventDispatch is used after instantiation --- src/runtime/internal/lifecycle.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/internal/lifecycle.ts b/src/runtime/internal/lifecycle.ts index 0ca3e4306d..d5938874fc 100644 --- a/src/runtime/internal/lifecycle.ts +++ b/src/runtime/internal/lifecycle.ts @@ -28,7 +28,7 @@ export function onDestroy(fn) { } export function createEventDispatcher() { - const component = current_component; + const component = get_current_component(); return (type, detail) => { const callbacks = component.$$.callbacks[type];