summaryrefslogtreecommitdiffstats
path: root/spec/basic.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2015-04-07 23:37:38 -0500
committerkpdecker <kpdecker@gmail.com>2015-04-07 23:37:38 -0500
commit2d149e779764cb373be0585c5e493da405062be6 (patch)
tree97ff4511e445c7d0a70161a0b3bbe02e7e5551e9 /spec/basic.js
parent81a4d50955b13e7d5e5052d904bb3e8c993ebb88 (diff)
downloadhandlebars.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.js10
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");