File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -545,7 +545,7 @@ AST.prototype = {
545
545
var args = [ ] ;
546
546
if ( this . peekToken ( ) . text !== ')' ) {
547
547
do {
548
- args . push ( this . expression ( ) ) ;
548
+ args . push ( this . filterChain ( ) ) ;
549
549
} while ( this . expect ( ',' ) ) ;
550
550
}
551
551
return args ;
Original file line number Diff line number Diff line change @@ -2139,6 +2139,15 @@ describe('parser', function() {
2139
2139
expect ( scope . $eval ( "add(1,2)" ) ) . toEqual ( 3 ) ;
2140
2140
} ) ;
2141
2141
2142
+ it ( 'should allow filter chains as arguments' , function ( ) {
2143
+ scope . concat = function ( a , b ) {
2144
+ return a + b ;
2145
+ } ;
2146
+ scope . begin = 1 ;
2147
+ scope . limit = 2 ;
2148
+ expect ( scope . $eval ( "concat('abcd'|limitTo:limit:begin,'abcd'|limitTo:2:1|uppercase)" ) ) . toEqual ( "bcBC" ) ;
2149
+ } ) ;
2150
+
2142
2151
it ( 'should evaluate function call from a return value' , function ( ) {
2143
2152
scope . getter = function ( ) { return function ( ) { return 33 ; } ; } ;
2144
2153
expect ( scope . $eval ( "getter()()" ) ) . toBe ( 33 ) ;
You can’t perform that action at this time.
0 commit comments