demo/mustache.js
function _compile(template, options) {
    var args = "view,partials,stack,lookup,escapeHTML,renderSection,render";
    var body = parse(template, options);
    var fn = new Function(args, body);

    // This anonymous function wraps the generated function so we can do
    // argument coercion, setup some variables, and handle any errors
    // encountered while executing it.
    return function (view, partials) {
      partials = partials || {};

      var stack = [view]; // context stack

      try {
        return fn(view, partials, stack, lookup, escapeHTML, renderSection, render);
      } catch (e) {
        throw debug(e.error, template, e.line, options.file);
      }
    };
  }
function _compile(template, options) {
    var args = "view,partials,stack,lookup,escapeHTML,renderSection,render";
    var body = parse(template, options);
    var fn = new Function(args, body);

    // This anonymous function wraps the generated function so we can do
    // argument coercion, setup some variables, and handle any errors
    // encountered while executing it.
    return function (view, partials) {
      partials = partials || {};

      var stack = [view]; // context stack

      try {
        return fn(view, partials, stack, lookup, escapeHTML, renderSection, render);
      } catch (e) {
        throw debug(e.error, template, e.line, options.file);
      }
    };
  }
function _compile ( template , options ) { var args = "view,partials,stack,lookup,escapeHTML,renderSection,render" ; var body = parse ( template , options ) ; var fn = new Function ( args , body ) ; // This anonymous function wraps the generated function so we can do // argument coercion, setup some variables, and handle any errors // encountered while executing it. return function ( view , partials ) { partials = partials || { } ; var stack = [ view ] ; // context stack try { return fn ( view , partials , stack , lookup , escapeHTML , renderSection , render ) ; } catch ( e ) { throw debug ( e . error , template , e . line , options . file ) ; } } ; }
Used by `compile` to generate a reusable function for the given `template`.
Used by compile to generate a reusable function for the given template .