diff options
Diffstat (limited to 'lib/handlebars/runtime.js')
-rw-r--r-- | lib/handlebars/runtime.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/handlebars/runtime.js b/lib/handlebars/runtime.js index 530dbd2..ec54f53 100644 --- a/lib/handlebars/runtime.js +++ b/lib/handlebars/runtime.js @@ -63,6 +63,14 @@ export function template(templateSpec, env) { // Just add water var container = { + lookup: function(depths, name) { + var len = depths.length; + for (var i = 0; i < len; i++) { + if (depths[i] && depths[i][name] != null) { + return depths[i][name]; + } + } + }, lambda: function(current, context) { return typeof current === 'function' ? current.call(context) : current; }, |