File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,18 @@ describe('compiler: v-for', () => {
253253 )
254254 } )
255255
256+ test ( 'missing source and have multiple spaces with' , ( ) => {
257+ const onError = vi . fn ( )
258+ parseWithForTransform ( '<span v-for="item in " />' , { onError } )
259+
260+ expect ( onError ) . toHaveBeenCalledTimes ( 1 )
261+ expect ( onError ) . toHaveBeenCalledWith (
262+ expect . objectContaining ( {
263+ code : ErrorCodes . X_V_FOR_MALFORMED_EXPRESSION
264+ } )
265+ )
266+ } )
267+
256268 test ( 'missing value' , ( ) => {
257269 const onError = vi . fn ( )
258270 parseWithForTransform ( '<span v-for="in items" />' , { onError } )
Original file line number Diff line number Diff line change @@ -499,4 +499,4 @@ export function getMemoedVNodeCall(node: BlockCodegenNode | MemoExpression) {
499499 }
500500}
501501
502- export const forAliasRE = / ( [ \s \S ] * ?) \s + (?: i n | o f ) \s + ( [ \s \S ] * ) /
502+ export const forAliasRE = / ( [ \s \S ] * ?) \s + (?: i n | o f ) \s + ( \S [ \s \S ] * ) /
You can’t perform that action at this time.
0 commit comments