File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ var controller = {
3535controller . model = {
3636 data : {
3737 key : 'green'
38+ , Math : {
39+ abs : "not a function"
40+ }
3841 , _page : {
3942 colors : {
4043 green : {
@@ -273,11 +276,19 @@ describe('Expression::get', function() {
273276 expect ( expression . get ( context ) ) . to . be . a ( Error ) ;
274277 } ) ;
275278
276- // None of these are supported yet, but ideally they would be
277279 it ( 'gets method call of the result of an fn expressions' , function ( ) {
278280 var expression = create ( '(_page.date).valueOf()' ) ;
279281 expect ( expression . get ( context ) ) . to . equal ( 1000 ) ;
280282 } ) ;
283+
284+ it ( 'gets the correct method even in case of duplicate paths' , function ( ) {
285+ var expression = create ( 'Math.abs(-5)' ) ;
286+ expect ( expression . get ( context ) ) . to . equal ( 5 ) ;
287+ expression = create ( 'Math.abs' ) ;
288+ expect ( expression . get ( context ) ) . to . equal ( 'not a function' ) ;
289+ } ) ;
290+
291+ // None of these are supported yet, but ideally they would be
281292 it . skip ( 'gets method call of the result of an fn expressions' , function ( ) {
282293 var expression = create ( 'passThrough(_page.date).valueOf()' ) ;
283294 expect ( expression . get ( context ) ) . to . equal ( 1000 ) ;
You can’t perform that action at this time.
0 commit comments