@@ -713,7 +713,7 @@ Parser.prototype = {
713
713
} ) ;
714
714
} ,
715
715
716
- functionCall : function ( fn , contextGetter ) {
716
+ functionCall : function ( fnGetter , contextGetter ) {
717
717
var argsFn = [ ] ;
718
718
if ( this . peekToken ( ) . text !== ')' ) {
719
719
do {
@@ -722,29 +722,28 @@ Parser.prototype = {
722
722
}
723
723
this . consume ( ')' ) ;
724
724
725
- var parser = this ;
725
+ var expressionText = this . text ;
726
726
var args = [ ] ; // we can safely reuse the array
727
727
728
728
return function ( scope , locals ) {
729
729
var context = contextGetter ? contextGetter ( scope , locals ) : scope ;
730
+ var fn = fnGetter ( scope , locals , context ) || noop ;
730
731
731
732
732
733
var i = argsFn . length ;
733
734
while ( i -- ) {
734
735
args [ i ] = argsFn [ i ] ( scope , locals ) ;
735
736
}
736
737
737
- var fnPtr = fn ( scope , locals , context ) || noop ;
738
-
739
- ensureSafeObject ( context , parser . text ) ;
740
- ensureSafeFunction ( fnPtr , parser . text ) ;
738
+ ensureSafeObject ( context , expressionText ) ;
739
+ ensureSafeFunction ( fn , expressionText ) ;
741
740
742
741
// IE stupidity! (IE doesn't have apply for some native functions)
743
- var v = fnPtr . apply
744
- ? fnPtr . apply ( context , args )
745
- : fnPtr ( args [ 0 ] , args [ 1 ] , args [ 2 ] , args [ 3 ] , args [ 4 ] ) ;
742
+ var v = fn . apply
743
+ ? fn . apply ( context , args )
744
+ : fn ( args [ 0 ] , args [ 1 ] , args [ 2 ] , args [ 3 ] , args [ 4 ] ) ;
746
745
747
- return ensureSafeObject ( v , parser . text ) ;
746
+ return ensureSafeObject ( v , expressionText ) ;
748
747
} ;
749
748
} ,
750
749
0 commit comments