summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/runtime.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/handlebars/runtime.js')
-rw-r--r--lib/handlebars/runtime.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/handlebars/runtime.js b/lib/handlebars/runtime.js
index 55a5c6f..f984fe6 100644
--- a/lib/handlebars/runtime.js
+++ b/lib/handlebars/runtime.js
@@ -23,8 +23,9 @@ function checkRevision(compilerInfo) {
// TODO: Remove this line and break up compilePartial
export function template(templateSpec, Hbars, compile) {
+ var invokePartialWrapper;
if (compile) {
- var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {
+ invokePartialWrapper = function(partial, name, context, helpers, partials, data) {
// TODO : Check this for all inputs and the options handling (partial flag, etc). This feels
// like there should be a common exec path
var result = invokePartial.apply(this, arguments);
@@ -35,7 +36,7 @@ export function template(templateSpec, Hbars, compile) {
return partials[name](context, options);
};
} else {
- var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {
+ invokePartialWrapper = function(partial, name, context, helpers, partials, data) {
var result = invokePartial.apply(this, arguments);
if (result) { return result; }
throw new Exception("The partial " + name + " could not be compiled when running in runtime-only mode");
@@ -103,25 +104,25 @@ export function template(templateSpec, Hbars, compile) {
export function programWithDepth(i, fn, data /*, $depth */) {
var args = Array.prototype.slice.call(arguments, 3);
- var program = function(context, options) {
+ var prog = function(context, options) {
options = options || {};
return fn.apply(this, [context, options.data || data].concat(args));
};
- program.program = i;
- program.depth = args.length;
- return program;
+ prog.program = i;
+ prog.depth = args.length;
+ return prog;
}
export function program(i, fn, data) {
- var program = function(context, options) {
+ var prog = function(context, options) {
options = options || {};
return fn(context, options.data || data);
};
- program.program = i;
- program.depth = 0;
- return program;
+ prog.program = i;
+ prog.depth = 0;
+ return prog;
}
export function invokePartial(partial, name, context, helpers, partials, data) {