@@ -40,16 +40,16 @@ describe('codegen', () => {
40
40
it ( 'generate v-for directive' , ( ) => {
41
41
assertCodegen (
42
42
'<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})})}`
44
44
)
45
45
// iterator syntax
46
46
assertCodegen (
47
47
'<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')})}`
49
49
)
50
50
assertCodegen (
51
51
'<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')})}`
53
53
)
54
54
} )
55
55
@@ -77,7 +77,7 @@ describe('codegen', () => {
77
77
it ( 'generate ref on v-for' , ( ) => {
78
78
assertCodegen (
79
79
'<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})})])}`
81
81
)
82
82
} )
83
83
@@ -304,7 +304,7 @@ describe('codegen', () => {
304
304
it ( 'generate static trees inside v-for' , ( ) => {
305
305
assertCodegen (
306
306
`<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)])})])}` ,
308
308
[ `with(this){return _h('span')}` ]
309
309
)
310
310
} )
0 commit comments