File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1941,6 +1941,17 @@ describe('compiler: parse', () => {
1941
1941
} )
1942
1942
} )
1943
1943
1944
+ test ( 'arg should be undefined on shorthand dirs with no arg' , ( ) => {
1945
+ const ast = baseParse ( `<template #></template>` )
1946
+ const el = ast . children [ 0 ] as ElementNode
1947
+ expect ( el . props [ 0 ] ) . toMatchObject ( {
1948
+ type : NodeTypes . DIRECTIVE ,
1949
+ name : 'slot' ,
1950
+ exp : undefined ,
1951
+ arg : undefined
1952
+ } )
1953
+ } )
1954
+
1944
1955
describe ( 'decodeEntities option' , ( ) => {
1945
1956
test ( 'use decode by default' , ( ) => {
1946
1957
const ast : any = baseParse ( '><&'"&foo;' )
Original file line number Diff line number Diff line change @@ -238,6 +238,7 @@ const tokenizer = new Tokenizer(stack, {
238
238
} ,
239
239
240
240
ondirarg ( start , end ) {
241
+ if ( start === end ) return
241
242
const arg = getSlice ( start , end )
242
243
if ( inVPre ) {
243
244
; ( currentProp as AttributeNode ) . name += arg
You can’t perform that action at this time.
0 commit comments