From f1fc81a49f5a399f0c3687bad96a135b0fbc4e65 Mon Sep 17 00:00:00 2001 From: Pavel Malyshev Date: Fri, 22 Jun 2018 21:05:29 +0300 Subject: [PATCH] Fix for #1553 --- src/compile/nodes/EventHandler.ts | 4 ++-- test/js/samples/event-handlers-custom/expected-bundle.js | 2 +- test/js/samples/event-handlers-custom/expected.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compile/nodes/EventHandler.ts b/src/compile/nodes/EventHandler.ts index 54dbd66157..6c15de7efd 100644 --- a/src/compile/nodes/EventHandler.ts +++ b/src/compile/nodes/EventHandler.ts @@ -67,12 +67,12 @@ export default class EventHandler extends Node { compiler.code.overwrite( this.insertionPoint, this.insertionPoint + 1, - `${component}.store.` + `return ${component}.store.` ); } else { compiler.code.prependRight( this.insertionPoint, - `${component}.` + `return ${component}.` ); } } diff --git a/test/js/samples/event-handlers-custom/expected-bundle.js b/test/js/samples/event-handlers-custom/expected-bundle.js index 78d5d1a005..501b2a9a3f 100644 --- a/test/js/samples/event-handlers-custom/expected-bundle.js +++ b/test/js/samples/event-handlers-custom/expected-bundle.js @@ -146,7 +146,7 @@ function create_main_fragment(component, ctx) { button = createElement("button"); button.textContent = "foo"; foo_handler = foo.call(component, button, function(event) { - component.foo( ctx.bar ); + return component.foo( ctx.bar ); }); }, diff --git a/test/js/samples/event-handlers-custom/expected.js b/test/js/samples/event-handlers-custom/expected.js index c72362620b..855bea59ba 100644 --- a/test/js/samples/event-handlers-custom/expected.js +++ b/test/js/samples/event-handlers-custom/expected.js @@ -19,7 +19,7 @@ function create_main_fragment(component, ctx) { button = createElement("button"); button.textContent = "foo"; foo_handler = foo.call(component, button, function(event) { - component.foo( ctx.bar ); + return component.foo( ctx.bar ); }); },