From 7489f70790d63140e7b75460f4f5ff2207843ca7 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Mon, 10 Sep 2012 10:07:33 -0700 Subject: [PATCH] Fix exports.to_html --- mustache.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/mustache.js b/mustache.js index 7280cfb..4843e3c 100644 --- a/mustache.js +++ b/mustache.js @@ -27,17 +27,6 @@ var Mustache; exports.Context = Context; exports.Writer = Writer; - // This is here for backwards compatibility with 0.4.x. - exports.to_html = function (template, view, partials, send) { - var result = render(template, view, partials); - - if (typeof send === "function") { - send(result); - } else { - return result; - } - }; - var whiteRe = /\s*/; var spaceRe = /\s+/; var nonSpaceRe = /\S/; @@ -597,6 +586,17 @@ var Mustache; return _writer.render(template, view, partials); }; + // This is here for backwards compatibility with 0.4.x. + exports.to_html = function (template, view, partials, send) { + var result = exports.render(template, view, partials); + + if (typeof send === "function") { + send(result); + } else { + return result; + } + }; + return exports; }())));