@@ -54,25 +54,25 @@ describe('codegen', () => {
5454 it ( 'generate v-for directive' , ( ) => {
5555 assertCodegen (
5656 '<div><li v-for="item in items" :key="item.uid"></li></div>' ,
57- `with(this){return _c('div',_l((items),function(item){return _c('li',{key:item.uid})}))}`
57+ `with(this){return _c('div',_l((items),function(item){return _c('li',{key:item.uid})}),0 )}`
5858 )
5959 // iterator syntax
6060 assertCodegen (
6161 '<div><li v-for="(item, i) in items"></li></div>' ,
62- `with(this){return _c('div',_l((items),function(item,i){return _c('li')}))}`
62+ `with(this){return _c('div',_l((items),function(item,i){return _c('li')}),0 )}`
6363 )
6464 assertCodegen (
6565 '<div><li v-for="(item, key, index) in items"></li></div>' ,
66- `with(this){return _c('div',_l((items),function(item,key,index){return _c('li')}))}`
66+ `with(this){return _c('div',_l((items),function(item,key,index){return _c('li')}),0 )}`
6767 )
6868 // destructuring
6969 assertCodegen (
7070 '<div><li v-for="{ a, b } in items"></li></div>' ,
71- `with(this){return _c('div',_l((items),function({ a, b }){return _c('li')}))}`
71+ `with(this){return _c('div',_l((items),function({ a, b }){return _c('li')}),0 )}`
7272 )
7373 assertCodegen (
7474 '<div><li v-for="({ a, b }, key, index) in items"></li></div>' ,
75- `with(this){return _c('div',_l((items),function({ a, b },key,index){return _c('li')}))}`
75+ `with(this){return _c('div',_l((items),function({ a, b },key,index){return _c('li')}),0 )}`
7676 )
7777 // v-for with extra element
7878 assertCodegen (
@@ -126,7 +126,7 @@ describe('codegen', () => {
126126 it ( 'generate ref on v-for' , ( ) => {
127127 assertCodegen (
128128 '<ul><li v-for="item in items" ref="component1"></li></ul>' ,
129- `with(this){return _c('ul',_l((items),function(item){return _c('li',{ref:"component1",refInFor:true})}))}`
129+ `with(this){return _c('ul',_l((items),function(item){return _c('li',{ref:"component1",refInFor:true})}),0 )}`
130130 )
131131 } )
132132
@@ -597,7 +597,7 @@ describe('codegen', () => {
597597 it ( 'generate static trees inside v-for' , ( ) => {
598598 assertCodegen (
599599 `<div><div v-for="i in 10"><p><span></span></p></div></div>` ,
600- `with(this){return _c('div',_l((10),function(i){return _c('div',[_m(0,true)])}))}` ,
600+ `with(this){return _c('div',_l((10),function(i){return _c('div',[_m(0,true)])}),0 )}` ,
601601 [ `with(this){return _c('p',[_c('span')])}` ]
602602 )
603603 } )
0 commit comments