Quellcode durchsuchen

manual cherry-pick for 9b27b2272c

tags/0.2
Jan Lehnardt vor 16 Jahren
Ursprung
Commit
01b2620aaa
1 geänderte Dateien mit 5 neuen und 4 gelöschten Zeilen
  1. +5
    -4
      mustache.js

+ 5
- 4
mustache.js Datei anzeigen

@@ -29,9 +29,9 @@ var Mustache = function() {
Tries to find a partial in the global scope and render it Tries to find a partial in the global scope and render it
*/ */
render_partial: function(name, context, partials) { render_partial: function(name, context, partials) {
if(typeof(context[name]) != "object") {
throw({message: "subcontext for '" + name + "' is not an object"});
}
if(typeof(context[name]) != "object") {
throw({message: "subcontext for '" + name + "' is not an object"});
}
if(!partials || !partials[name]) { if(!partials || !partials[name]) {
throw({message: "unknown_partial"}); throw({message: "unknown_partial"});
} }
@@ -89,7 +89,8 @@ var Mustache = function() {
case "=": // set new delimiters, rebuild the replace regexp case "=": // set new delimiters, rebuild the replace regexp
that.set_delimiters(name); that.set_delimiters(name);
regex = new_regex(); regex = new_regex();
// redo the line in order to get tags with the new delimiters on the same line
// redo the line in order to get tags with the new delimiters
// on the same line
i--; i--;
return ""; return "";
case "<": // render partial case "<": // render partial


Laden…
Abbrechen
Speichern