File tree 9 files changed +2011
-2
lines changed
Filter options
v-on-async-arrow-function-expression
v-on-async-function-expression
9 files changed +2011
-2
lines changed
Original file line number Diff line number Diff line change @@ -75,8 +75,15 @@ const PARENS = /^(\s*\()([\s\S]*?)(\)\s*)$/u
75
75
const DUMMY_PARENT : any = { }
76
76
77
77
// Like Vue, it judges whether it is a function expression or not.
78
- // https://github.com/vuejs/vue/blob/0948d999f2fddf9f90991956493f976273c5da1f/src/compiler/codegen/events.js#L3
79
- const IS_FUNCTION_EXPRESSION = / ^ \s * ( [ \w $ _ ] + | \( [ ^ ) ] * ?\) ) \s * = > | ^ f u n c t i o n \s * \( / u
78
+ // https://github.com/vuejs/core/blob/fef2acb2049fce3407dff17fe8af1836b97dfd73/packages/compiler-core/src/transforms/vOn.ts#L19
79
+ const IS_FUNCTION_EXPRESSION =
80
+ / ^ \s * ( [ \w $ _ ] + | ( a s y n c \s * ) ? \( [ ^ ) ] * ?\) ) \s * ( : [ ^ = ] + ) ? = > | ^ \s * ( a s y n c \s + ) ? f u n c t i o n (?: \s + [ \w $ ] + ) ? \s * \( / u
81
+ // ^^^^^^^ omit paren argument ^^^^^^^^ function keyword
82
+ // ^^^^^ <--- async keyword (optional) ---> ^^^^^
83
+ // ^^------^^ arguments with parens ^^^^^^ named function (optional)
84
+ // ^^^^^^^^^ return types (optional)
85
+ // ^^ arrow ^^ opening paren
86
+
80
87
const IS_SIMPLE_PATH =
81
88
/ ^ [ A - Z a - z _ $ ] [ \w $ ] * (?: \. [ A - Z a - z _ $ ] [ \w $ ] * | \[ ' [ ^ ' ] * ?' \] | \[ " [ ^ " ] * ?" \] | \[ \d + \] | \[ [ A - Z a - z _ $ ] [ \w $ ] * \] ) * $ / u
82
89
You can’t perform that action at this time.
0 commit comments