diff options
author | kpdecker <kpdecker@gmail.com> | 2014-07-12 12:50:54 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2014-07-12 12:50:54 -0500 |
commit | 271106d43fae96fc1287898568d000b871f19084 (patch) | |
tree | de4a23fe43b7e4d7cbec1830543b317751a03cfa /spec/helpers.js | |
parent | 1fb7b51ee6bb8f4a2e395821a4648333a699a982 (diff) | |
download | handlebars.js-271106d43fae96fc1287898568d000b871f19084.zip handlebars.js-271106d43fae96fc1287898568d000b871f19084.tar.gz handlebars.js-271106d43fae96fc1287898568d000b871f19084.tar.bz2 |
Do not lookup pathed helpers on the helper stack
Fixes #764
Diffstat (limited to 'spec/helpers.js')
-rw-r--r-- | spec/helpers.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/helpers.js b/spec/helpers.js index 6ba368e..d686b64 100644 --- a/spec/helpers.js +++ b/spec/helpers.js @@ -158,6 +158,22 @@ describe('helpers', function() { shouldCompileTo(messageString, [rootMessage, { list: list }], "<p>Nobody's here</p>", "the context of an inverse is the parent of the block"); }); + it('pathed lambas with parameters', function() { + var hash = { + helper: function() { + return 'winning'; + } + }; + hash.hash = hash; + var helpers = { + './helper': function() { + return 'fail'; + } + }; + shouldCompileTo('{{./helper 1}}', [hash, helpers], 'winning'); + shouldCompileTo('{{hash/helper 1}}', [hash, helpers], 'winning'); + }); + describe("helpers hash", function() { it("providing a helpers hash", function() { shouldCompileTo("Goodbye {{cruel}} {{world}}!", [{cruel: "cruel"}, {world: function() { return "world"; }}], "Goodbye cruel world!", |