diff options
author | kpdecker <kpdecker@gmail.com> | 2015-04-07 23:37:38 -0500 |
---|---|---|
committer | kpdecker <kpdecker@gmail.com> | 2015-04-07 23:37:38 -0500 |
commit | 2d149e779764cb373be0585c5e493da405062be6 (patch) | |
tree | 97ff4511e445c7d0a70161a0b3bbe02e7e5551e9 /spec/basic.js | |
parent | 81a4d50955b13e7d5e5052d904bb3e8c993ebb88 (diff) | |
download | handlebars.js-2d149e779764cb373be0585c5e493da405062be6.zip handlebars.js-2d149e779764cb373be0585c5e493da405062be6.tar.gz handlebars.js-2d149e779764cb373be0585c5e493da405062be6.tar.bz2 |
Add undefined and null literal support
This adds the UndefinedLiteral and NullLiteral to AST.
Fixes #990
Diffstat (limited to 'spec/basic.js')
-rw-r--r-- | spec/basic.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/basic.js b/spec/basic.js index 9b6678a..11002e4 100644 --- a/spec/basic.js +++ b/spec/basic.js @@ -66,6 +66,16 @@ describe("basic context", function() { shouldCompileTo('val: {{{val1/val2}}}', {val1: {val2: false}}, 'val: false'); }); + it('should handle undefined and null', function() { + shouldCompileTo('{{awesome undefined null}}', + { + awesome: function(_undefined, _null, options) { + return (_undefined === undefined) + ' ' + (_null === null) + ' ' + (typeof options); + } + }, + 'true true object'); + }); + it("newlines", function() { shouldCompileTo("Alan's\nTest", {}, "Alan's\nTest"); shouldCompileTo("Alan's\rTest", {}, "Alan's\rTest"); |