diff options
author | kpdecker <kpdecker@gmail.com> | 2014-07-06 12:53:01 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2014-07-06 12:53:01 -0500 |
commit | 4aad72d2230a6eaaf242130c57ad1efa4d701f3c (patch) | |
tree | 5ef8394e33ce3206032fe6b256db0b64444af694 /lib/handlebars/runtime.js | |
parent | 704961b37840a439d6576a0d8f0f595838ab0963 (diff) | |
download | handlebars.js-4aad72d2230a6eaaf242130c57ad1efa4d701f3c.zip handlebars.js-4aad72d2230a6eaaf242130c57ad1efa4d701f3c.tar.gz handlebars.js-4aad72d2230a6eaaf242130c57ad1efa4d701f3c.tar.bz2 |
Move lambda resolution to runtime
This has a very positive impact on precompiled output size, particularly for known-helpers cases, and little or no impact on the throughput numbers.
Diffstat (limited to 'lib/handlebars/runtime.js')
-rw-r--r-- | lib/handlebars/runtime.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/handlebars/runtime.js b/lib/handlebars/runtime.js index d43f465..b9fc77d 100644 --- a/lib/handlebars/runtime.js +++ b/lib/handlebars/runtime.js @@ -50,6 +50,10 @@ export function template(templateSpec, env) { // Just add water var container = { + lambda: function(current, context) { + return typeof current === 'function' ? current.call(context) : current; + }, + escapeExpression: Utils.escapeExpression, invokePartial: invokePartialWrapper, |