diff options
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index be17ac3..7acff1f 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -453,10 +453,17 @@ export function compile(input, options, env) { } // Template is only compiled on first use and cached after that point. - return function(context, options) { + var ret = function(context, options) { if (!compiled) { compiled = compileInput(); } return compiled.call(this, context, options); }; + ret.child = function(i) { + if (!compiled) { + compiled = compileInput(); + } + return compiled.child(i); + }; + return ret; } |