Skip to content

Commit 000dc29

Browse files
authored
Merge pull request #1557 from PaulMaly/1553-return-from-custom-event-handler
Fix for #1553
2 parents 3560b86 + f1fc81a commit 000dc29

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/compile/nodes/EventHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ export default class EventHandler extends Node {
6767
compiler.code.overwrite(
6868
this.insertionPoint,
6969
this.insertionPoint + 1,
70-
`${component}.store.`
70+
`return ${component}.store.`
7171
);
7272
} else {
7373
compiler.code.prependRight(
7474
this.insertionPoint,
75-
`${component}.`
75+
`return ${component}.`
7676
);
7777
}
7878
}

test/js/samples/event-handlers-custom/expected-bundle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function create_main_fragment(component, ctx) {
146146
button = createElement("button");
147147
button.textContent = "foo";
148148
foo_handler = foo.call(component, button, function(event) {
149-
component.foo( ctx.bar );
149+
return component.foo( ctx.bar );
150150
});
151151
},
152152

test/js/samples/event-handlers-custom/expected.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function create_main_fragment(component, ctx) {
1919
button = createElement("button");
2020
button.textContent = "foo";
2121
foo_handler = foo.call(component, button, function(event) {
22-
component.foo( ctx.bar );
22+
return component.foo( ctx.bar );
2323
});
2424
},
2525

0 commit comments

Comments
 (0)