@@ -56,7 +56,7 @@ describe('compiler: template ref transform', () => {
5656 } )
5757 expect ( code ) . matchSnapshot ( )
5858 // pass the actual ref and ref key
59- expect ( code ) . contains ( '_setTemplateRef(n0, foo, null, null, "foo")' )
59+ expect ( code ) . contains ( '_setTemplateRef(n0, foo, null, "foo")' )
6060 } )
6161
6262 test ( 'dynamic ref' , ( ) => {
@@ -67,12 +67,6 @@ describe('compiler: template ref transform', () => {
6767 flags : DynamicFlag . REFERENCED ,
6868 } )
6969 expect ( [ ...ir . template . keys ( ) ] ) . toEqual ( [ '<div>' ] )
70- expect ( ir . block . operation ) . toMatchObject ( [
71- {
72- type : IRNodeTypes . DECLARE_OLD_REF ,
73- id : 0 ,
74- } ,
75- ] )
7670 expect ( ir . block . effect ) . toMatchObject ( [
7771 {
7872 operations : [
@@ -89,7 +83,7 @@ describe('compiler: template ref transform', () => {
8983 ] )
9084 expect ( code ) . matchSnapshot ( )
9185 expect ( code ) . contains ( 'const _setTemplateRef = _createTemplateRefSetter()' )
92- expect ( code ) . contains ( '_setTemplateRef(n0, _ctx.foo, r0 )' )
86+ expect ( code ) . contains ( '_setTemplateRef(n0, _ctx.foo)' )
9387 } )
9488
9589 test ( 'function ref' , ( ) => {
@@ -105,12 +99,6 @@ describe('compiler: template ref transform', () => {
10599 flags : DynamicFlag . REFERENCED ,
106100 } )
107101 expect ( [ ...ir . template . keys ( ) ] ) . toEqual ( [ '<div>' ] )
108- expect ( ir . block . operation ) . toMatchObject ( [
109- {
110- type : IRNodeTypes . DECLARE_OLD_REF ,
111- id : 0 ,
112- } ,
113- ] )
114102 expect ( ir . block . effect ) . toMatchObject ( [
115103 {
116104 operations : [
@@ -130,7 +118,7 @@ describe('compiler: template ref transform', () => {
130118 _foo.value = bar
131119 ;({ baz: _ctx.baz } = bar)
132120 console.log(_foo.value, _ctx.baz)
133- }, r0 )` )
121+ })` )
134122 } )
135123
136124 test ( 'ref + v-if' , ( ) => {
@@ -178,6 +166,6 @@ describe('compiler: template ref transform', () => {
178166 ] )
179167 expect ( code ) . matchSnapshot ( )
180168 expect ( code ) . contains ( 'const _setTemplateRef = _createTemplateRefSetter()' )
181- expect ( code ) . contains ( '_setTemplateRef(n2, "foo", void 0, true)' )
169+ expect ( code ) . contains ( '_setTemplateRef(n2, "foo", true)' )
182170 } )
183171} )
0 commit comments