Skip to content

Commit 7a11b75

Browse files
committed
on second thoughts
1 parent 91aabf5 commit 7a11b75

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

src/compiler/compile/nodes/Action.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default class Action extends Node {
1717
component.qualify(info.name);
1818

1919
this.expression = info.expression
20-
? new Expression(component, this, scope, info.expression, true)
20+
? new Expression(component, this, scope, info.expression)
2121
: null;
2222

2323
this.uses_context = this.expression && this.expression.uses_context;

src/compiler/compile/nodes/shared/Expression.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ export default class Expression {
146146

147147
contextual_dependencies.add(name);
148148

149-
if (!function_expression || !lazy) {
149+
if (!lazy) {
150150
template_scope.dependencies_for_name.get(name).forEach(name => dependencies.add(name));
151151
}
152152
} else {
153-
if (!function_expression || !lazy) {
153+
if (!lazy) {
154154
dependencies.add(name);
155155
}
156156

test/js/samples/action-custom-event-handler/expected.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ function create_fragment(ctx) {
2323
foo_action = foo.call(null, button, ctx.foo_function) || {};
2424
},
2525

26-
p: noop,
26+
p(changed, ctx) {
27+
if (typeof foo_action.update === 'function' && changed.bar) {
28+
foo_action.update.call(null, ctx.foo_function);
29+
}
30+
},
31+
2732
i: noop,
2833
o: noop,
2934

0 commit comments

Comments
 (0)