From 01b2620aaaeea558f884a6506ba8114789f4b193 Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Sat, 31 Oct 2009 14:50:25 +0100 Subject: [PATCH] manual cherry-pick for 9b27b2272cf6824cd49b08a79f092e85016bf187 --- mustache.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mustache.js b/mustache.js index fbbb715..06afe86 100644 --- a/mustache.js +++ b/mustache.js @@ -29,9 +29,9 @@ var Mustache = function() { Tries to find a partial in the global scope and render it */ 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]) { throw({message: "unknown_partial"}); } @@ -89,7 +89,8 @@ var Mustache = function() { case "=": // set new delimiters, rebuild the replace regexp that.set_delimiters(name); 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--; return ""; case "<": // render partial