@@ -177,7 +177,11 @@ if (_.inBrowser) {
177177 }
178178 }
179179 } ,
180- 'withDataPrefix'
180+ 'withDataPrefix' ,
181+ {
182+ name : 'forceTwoWay' ,
183+ twoWay : true
184+ }
181185 ] . map ( function ( p ) {
182186 return typeof p === 'string' ? { name : p } : p
183187 } )
@@ -193,9 +197,10 @@ if (_.inBrowser) {
193197 el . setAttribute ( 'boolean-literal' , '{{true}}' )
194198 el . setAttribute ( 'boolean' , '' )
195199 el . setAttribute ( 'data-with-data-prefix' , '1' )
200+ el . setAttribute ( 'force-two-way' , '{{a}}' )
196201 compiler . compileAndLinkProps ( vm , el , props )
197202 // should skip literals and one-time bindings
198- expect ( vm . _bindDir . calls . count ( ) ) . toBe ( 4 )
203+ expect ( vm . _bindDir . calls . count ( ) ) . toBe ( 5 )
199204 // data-some-attr
200205 var args = vm . _bindDir . calls . argsFor ( 0 )
201206 expect ( args [ 0 ] ) . toBe ( 'prop' )
@@ -228,6 +233,8 @@ if (_.inBrowser) {
228233 expect ( args [ 2 ] . parentPath ) . toBe ( 'this._applyFilters(a,null,[{"name":"filter"}],false)' )
229234 expect ( args [ 2 ] . mode ) . toBe ( bindingModes . ONE_WAY )
230235 expect ( args [ 3 ] ) . toBe ( def )
236+ // warn when expecting two-way binding but not getting it
237+ expect ( hasWarned ( _ , 'expects a two-way binding type' ) ) . toBe ( true )
231238 // literal and one time should've been set on the _data
232239 // and numbers should be casted
233240 expect ( Object . keys ( vm . _data ) . length ) . toBe ( 10 )
0 commit comments