refactor: only inject rest args for member expression handlers + fix tests

This commit is contained in:
Evan You
2020-06-15 15:24:46 -04:00
parent 7e28173312
commit 605953a154
2 changed files with 9 additions and 11 deletions

View File

@@ -102,7 +102,9 @@ export const transformOn: DirectiveTransform = (
if (isInlineStatement || (isCacheable && isMemberExp)) {
// wrap inline statement in a function expression
exp = createCompoundExpression([
`($event, ...args) => ${hasMultipleStatements ? `{` : `(`}`,
`${isInlineStatement ? `$event` : `($event, ...args)`} => ${
hasMultipleStatements ? `{` : `(`
}`,
exp,
hasMultipleStatements ? `}` : `)`
])