|
|
|
@ -1139,16 +1139,20 @@ function serialize_event_handler(node, { state, visit }) {
|
|
|
|
handler = node.expression;
|
|
|
|
handler = node.expression;
|
|
|
|
|
|
|
|
|
|
|
|
// Event handlers can be dynamic (source/store/prop/conditional etc)
|
|
|
|
// Event handlers can be dynamic (source/store/prop/conditional etc)
|
|
|
|
const dynamic_handler = () => {
|
|
|
|
const dynamic_handler = () =>
|
|
|
|
return b.arrow(
|
|
|
|
b.function(
|
|
|
|
|
|
|
|
null,
|
|
|
|
[b.rest(b.id('$$args'))],
|
|
|
|
[b.rest(b.id('$$args'))],
|
|
|
|
|
|
|
|
b.block([
|
|
|
|
|
|
|
|
b.return(
|
|
|
|
b.call(
|
|
|
|
b.call(
|
|
|
|
b.member(/** @type {Expression} */ (visit(handler)), b.id('apply'), false, true),
|
|
|
|
b.member(/** @type {Expression} */ (visit(handler)), b.id('apply'), false, true),
|
|
|
|
b.this,
|
|
|
|
b.this,
|
|
|
|
b.id('$$args')
|
|
|
|
b.id('$$args')
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
])
|
|
|
|
);
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (handler.type === 'Identifier' || handler.type === 'MemberExpression') {
|
|
|
|
if (handler.type === 'Identifier' || handler.type === 'MemberExpression') {
|
|
|
|
const id = object(handler);
|
|
|
|
const id = object(handler);
|
|
|
|
|