chore: tidy up dynamic event handler generated code (#12553)

* chore: tidy up dynamic event handler generated code

* actually we need a proper function
pull/12564/head
Rich Harris 4 months ago committed by GitHub
parent e2b75d1a6e
commit 7b2279d84c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
chore: tidy up dynamic event handler generated code

@ -1137,9 +1137,12 @@ function serialize_event_handler(node, { state, visit }) {
null, null,
[b.rest(b.id('$$args'))], [b.rest(b.id('$$args'))],
b.block([ b.block([
b.const('$$callback', /** @type {Expression} */ (visit(handler))),
b.return( b.return(
b.call(b.member(b.id('$$callback'), b.id('apply'), false, true), b.this, b.id('$$args')) b.call(
b.member(/** @type {Expression} */ (visit(handler)), b.id('apply'), false, true),
b.this,
b.id('$$args')
)
) )
]) ])
); );

Loading…
Cancel
Save