demo/mustache.js
function debug(e, template, line, file) {
    file = file || "<template>";

    var lines = template.split("\n"),
        start = Math.max(line - 3, 0),
        end = Math.min(lines.length, line + 3),
        context = lines.slice(start, end);

    var c;
    for (var i = 0, len = context.length; i < len; ++i) {
      c = i + start + 1;
      context[i] = (c === line ? " >> " : "    ") + context[i];
    }

    e.template = template;
    e.line = line;
    e.file = file;
    e.message = [file + ":" + line, context.join("\n"), "", e.message].join("\n");

    return e;
  }
function debug(e, template, line, file) {
    file = file || "<template>";

    var lines = template.split("\n"),
        start = Math.max(line - 3, 0),
        end = Math.min(lines.length, line + 3),
        context = lines.slice(start, end);

    var c;
    for (var i = 0, len = context.length; i < len; ++i) {
      c = i + start + 1;
      context[i] = (c === line ? " >> " : "    ") + context[i];
    }

    e.template = template;
    e.line = line;
    e.file = file;
    e.message = [file + ":" + line, context.join("\n"), "", e.message].join("\n");

    return e;
  }
function debug ( e , template , line , file ) { file = file || "<template>" ; var lines = template . split ( "\n" ) , start = Math . max ( line - 3 , 0 ) , end = Math . min ( lines . length , line + 3 ) , context = lines . slice ( start , end ) ; var c ; for ( var i = 0 , len = context . length ; i < len ; ++ i ) { c = i + start + 1 ; context [ i ] = ( c === line ? " >> " : "    " ) + context [ i ] ; } e . template = template ; e . line = line ; e . file = file ; e . message = [ file + ":" + line , context . join ( "\n" ) , "" , e . message ] . join ( "\n" ) ; return e ; }
Adds the `template`, `line`, and `file` properties to the given error
object and alters the message to provide more useful debugging information.
Adds the template line and file properties to the given error object and alters the message to provide more useful debugging information .