@@ -146,6 +146,7 @@ if (_.inBrowser) {
146146 } )
147147
148148 it ( 'props' , function ( ) {
149+ var bindingModes = Vue . config . _propBindingModes
149150 var options = _ . mergeOptions ( Vue . options , {
150151 _asComponent : true ,
151152 props : [
@@ -154,8 +155,7 @@ if (_.inBrowser) {
154155 'some-other-attr' ,
155156 'multiple-attrs' ,
156157 'onetime' ,
157- 'oneway-up' ,
158- 'oneway-down' ,
158+ 'twoway' ,
159159 'with-filter' ,
160160 'camelCase' ,
161161 'boolean-literal'
@@ -167,52 +167,44 @@ if (_.inBrowser) {
167167 el . setAttribute ( 'some-other-attr' , '2' )
168168 el . setAttribute ( 'multiple-attrs' , 'a {{b}} c' )
169169 el . setAttribute ( 'onetime' , '{{*a}}' )
170- el . setAttribute ( 'oneway-up' , '{{>a}}' )
171- el . setAttribute ( 'oneway-down' , '{{<a}}' )
170+ el . setAttribute ( 'twoway' , '{{@a}}' )
172171 el . setAttribute ( 'with-filter' , '{{a | filter}}' )
173172 el . setAttribute ( 'boolean-literal' , '{{true}}' )
174173 transclude ( el , options )
175174 compiler . compileAndLinkRoot ( vm , el , options )
176175 // should skip literals and one-time bindings
177- expect ( vm . _bindDir . calls . count ( ) ) . toBe ( 5 )
176+ expect ( vm . _bindDir . calls . count ( ) ) . toBe ( 4 )
178177 // data-some-attr
179178 var args = vm . _bindDir . calls . argsFor ( 0 )
180179 expect ( args [ 0 ] ) . toBe ( 'prop' )
181180 expect ( args [ 1 ] ) . toBe ( null )
182181 expect ( args [ 2 ] . path ) . toBe ( 'someAttr' )
183182 expect ( args [ 2 ] . parentPath ) . toBe ( 'a' )
183+ expect ( args [ 2 ] . mode ) . toBe ( bindingModes . ONE_WAY )
184184 expect ( args [ 3 ] ) . toBe ( def )
185185 // multiple-attrs
186186 args = vm . _bindDir . calls . argsFor ( 1 )
187187 expect ( args [ 0 ] ) . toBe ( 'prop' )
188188 expect ( args [ 1 ] ) . toBe ( null )
189189 expect ( args [ 2 ] . path ) . toBe ( 'multipleAttrs' )
190190 expect ( args [ 2 ] . parentPath ) . toBe ( '"a "+(b)+" c"' )
191+ expect ( args [ 2 ] . mode ) . toBe ( bindingModes . ONE_WAY )
191192 expect ( args [ 3 ] ) . toBe ( def )
192- // one way up
193+ // two way
193194 args = vm . _bindDir . calls . argsFor ( 2 )
194195 expect ( args [ 0 ] ) . toBe ( 'prop' )
195196 expect ( args [ 1 ] ) . toBe ( null )
196- expect ( args [ 2 ] . path ) . toBe ( 'onewayUp' )
197- expect ( args [ 2 ] . oneWayUp ) . toBe ( true )
198- expect ( args [ 2 ] . oneWayDown ) . toBe ( false )
199- expect ( args [ 2 ] . parentPath ) . toBe ( 'a' )
200- expect ( args [ 3 ] ) . toBe ( def )
201- // one way down
202- args = vm . _bindDir . calls . argsFor ( 3 )
203- expect ( args [ 0 ] ) . toBe ( 'prop' )
204- expect ( args [ 1 ] ) . toBe ( null )
205- expect ( args [ 2 ] . path ) . toBe ( 'onewayDown' )
206- expect ( args [ 2 ] . oneWayUp ) . toBe ( false )
207- expect ( args [ 2 ] . oneWayDown ) . toBe ( true )
197+ expect ( args [ 2 ] . path ) . toBe ( 'twoway' )
198+ expect ( args [ 2 ] . mode ) . toBe ( bindingModes . TWO_WAY )
208199 expect ( args [ 2 ] . parentPath ) . toBe ( 'a' )
209200 expect ( args [ 3 ] ) . toBe ( def )
210201 // with-filter
211- args = vm . _bindDir . calls . argsFor ( 4 )
202+ args = vm . _bindDir . calls . argsFor ( 3 )
212203 expect ( args [ 0 ] ) . toBe ( 'prop' )
213204 expect ( args [ 1 ] ) . toBe ( null )
214205 expect ( args [ 2 ] . path ) . toBe ( 'withFilter' )
215206 expect ( args [ 2 ] . parentPath ) . toBe ( 'this._applyFilters(a,null,[{"name":"filter"}],false)' )
207+ expect ( args [ 2 ] . mode ) . toBe ( bindingModes . ONE_WAY )
216208 expect ( args [ 3 ] ) . toBe ( def )
217209 // camelCase should've warn
218210 expect ( hasWarned ( _ , 'using camelCase' ) ) . toBe ( true )
0 commit comments