From 7ccffd5fd7c0b31452c7832c2953a926bcb3ccc0 Mon Sep 17 00:00:00 2001 From: Sahab Yazdani Date: Tue, 26 Apr 2011 15:24:54 -0400 Subject: [PATCH] All relevent tests are now green. Wo0t! --- mustache.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/mustache.js b/mustache.js index c50104a..5167837 100644 --- a/mustache.js +++ b/mustache.js @@ -275,8 +275,8 @@ var Mustache = (function(undefined) { } function section(parserContext) { - function create_section_context(s) { - var context = create_parser_context(s.template_buffer.join(''), + function create_section_context(template) { + var context = create_parser_context(template, parserContext.partials, null, parserContext.user_send_func, @@ -309,12 +309,12 @@ var Mustache = (function(undefined) { if (s.inverted) { if (!value || is_array(value) && value.length === 0) { // false or empty list, render it - new_parser_context = create_section_context(s); + new_parser_context = create_section_context(s.template_buffer.join('')); parse(new_parser_context); } } else { if (is_array(value)) { // Enumerable, Let's loop! - new_parser_context = create_section_context(s); + new_parser_context = create_section_context(s.template_buffer.join('')); for (i=0, n=value.length; i