File tree 2 files changed +6
-1
lines changed
test/unit/modules/compiler
2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 1
1
/* @flow */
2
2
3
- const fnExpRE = / ^ ( [ \w $ _ ] + | \( [ ^ ) ] * ?\) ) \s * = > | ^ f u n c t i o n \s * \( /
3
+ const fnExpRE = / ^ ( [ \w $ _ ] + | \( [ ^ ) ] * ?\) ) \s * = > | ^ f u n c t i o n \s * (?: [ \w $ ] + ) ? \s * \( /
4
4
const fnInvokeRE = / \( [ ^ ) ] * ?\) ; * $ /
5
5
const simplePathRE = / ^ [ A - Z a - z _ $ ] [ \w $ ] * (?: \. [ A - Z a - z _ $ ] [ \w $ ] * | \[ ' [ ^ ' ] * ?' ] | \[ " [ ^ " ] * ?" ] | \[ \d + ] | \[ [ A - Z a - z _ $ ] [ \w $ ] * ] ) * $ /
6
6
Original file line number Diff line number Diff line change @@ -500,6 +500,11 @@ describe('codegen', () => {
500
500
'<input @input="function () { current++ }">' ,
501
501
`with(this){return _c('input',{on:{"input":function () { current++ }}})}`
502
502
)
503
+ // normal named function
504
+ assertCodegen (
505
+ '<input @input="function fn () { current++ }">' ,
506
+ `with(this){return _c('input',{on:{"input":function fn () { current++ }}})}`
507
+ )
503
508
// arrow with no args
504
509
assertCodegen (
505
510
'<input @input="()=>current++">' ,
You can’t perform that action at this time.
0 commit comments