@@ -229,7 +229,7 @@ var Mustache;
229
229
}
230
230
}
231
231
232
- return fn ( Context . make ( view ) , self , template ) ;
232
+ return fn ( self , Context . make ( view ) , template ) ;
233
233
} ;
234
234
}
235
235
@@ -245,13 +245,13 @@ var Mustache;
245
245
var buffer = "" ;
246
246
247
247
for ( var i = 0 , len = value . length ; i < len ; ++ i ) {
248
- buffer += callback ( context . push ( value [ i ] ) , this ) ;
248
+ buffer += callback ( this , context . push ( value [ i ] ) ) ;
249
249
}
250
250
251
251
return buffer ;
252
252
}
253
253
254
- return value ? callback ( context . push ( value ) , this ) : "" ;
254
+ return value ? callback ( this , context . push ( value ) ) : "" ;
255
255
case "function" :
256
256
var self = this ;
257
257
var scopedRender = function ( template ) {
@@ -261,7 +261,7 @@ var Mustache;
261
261
return value . call ( context . view , text , scopedRender ) || "" ;
262
262
default :
263
263
if ( value ) {
264
- return callback ( context , this ) ;
264
+ return callback ( this , context ) ;
265
265
}
266
266
}
267
267
@@ -274,7 +274,7 @@ var Mustache;
274
274
// Use JavaScript's definition of falsy. Include empty arrays.
275
275
// See https://github.com/janl/mustache.js/issues/186
276
276
if ( ! value || ( isArray ( value ) && value . length === 0 ) ) {
277
- return callback ( context , this ) ;
277
+ return callback ( this , context ) ;
278
278
}
279
279
280
280
return "" ;
@@ -328,16 +328,17 @@ var Mustache;
328
328
function subRender ( i , tokens , template ) {
329
329
if ( ! subRenders [ i ] ) {
330
330
var render = compileTokens ( tokens ) ;
331
- subRenders [ i ] = function ( context , writer ) {
332
- return render ( context , writer , template ) ;
331
+ subRenders [ i ] = function ( writer , context ) {
332
+ return render ( writer , context , template ) ;
333
333
} ;
334
334
}
335
335
336
336
return subRenders [ i ] ;
337
337
}
338
338
339
- function renderFunction ( context , writer , template ) {
340
- var buffer = [ ] , text ;
339
+ function renderFunction ( writer , context , template ) {
340
+ var buffer = [ ] ;
341
+ var token , text ;
341
342
342
343
for ( var i = 0 , len = tokens . length ; i < len ; ++ i ) {
343
344
token = tokens [ i ] ;
0 commit comments