@@ -40,16 +40,16 @@ describe('codegen', () => {
4040 it ( 'generate v-for directive' , ( ) => {
4141 assertCodegen (
4242 '<li v-for="item in items" :key="item.uid"></li>' ,
43- `with(this){return (items)&& _l((items),function(item){return _h('li',{key:item.uid})})}`
43+ `with(this){return _l((items),function(item){return _h('li',{key:item.uid})})}`
4444 )
4545 // iterator syntax
4646 assertCodegen (
4747 '<li v-for="(item, i) in items"></li>' ,
48- `with(this){return (items)&& _l((items),function(item,i){return _h('li')})}`
48+ `with(this){return _l((items),function(item,i){return _h('li')})}`
4949 )
5050 assertCodegen (
5151 '<li v-for="(item, key, index) in items"></li>' ,
52- `with(this){return (items)&& _l((items),function(item,key,index){return _h('li')})}`
52+ `with(this){return _l((items),function(item,key,index){return _h('li')})}`
5353 )
5454 } )
5555
@@ -77,7 +77,7 @@ describe('codegen', () => {
7777 it ( 'generate ref on v-for' , ( ) => {
7878 assertCodegen (
7979 '<ul><li v-for="item in items" ref="component1"></li></ul>' ,
80- `with(this){return _h('ul',[(items)&& _l((items),function(item){return _h('li',{ref:"component1",refInFor:true})})])}`
80+ `with(this){return _h('ul',[_l((items),function(item){return _h('li',{ref:"component1",refInFor:true})})])}`
8181 )
8282 } )
8383
@@ -304,7 +304,7 @@ describe('codegen', () => {
304304 it ( 'generate static trees inside v-for' , ( ) => {
305305 assertCodegen (
306306 `<div><div v-for="i in 10"><span></span></div></div>` ,
307- `with(this){return _h('div',[(10)&& _l((10),function(i){return _h('div',[_m(0,true)])})])}` ,
307+ `with(this){return _h('div',[_l((10),function(i){return _h('div',[_m(0,true)])})])}` ,
308308 [ `with(this){return _h('span')}` ]
309309 )
310310 } )
0 commit comments