summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/ast.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 /lib/handlebars/compiler/ast.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 'lib/handlebars/compiler/ast.js')
-rw-r--r--lib/handlebars/compiler/ast.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/handlebars/compiler/ast.js b/lib/handlebars/compiler/ast.js
index 45212b3..e5904c6 100644
--- a/lib/handlebars/compiler/ast.js
+++ b/lib/handlebars/compiler/ast.js
@@ -101,6 +101,18 @@ var AST = {
this.value = bool === 'true';
},
+ UndefinedLiteral: function(locInfo) {
+ this.loc = locInfo;
+ this.type = 'UndefinedLiteral';
+ this.original = this.value = undefined;
+ },
+
+ NullLiteral: function(locInfo) {
+ this.loc = locInfo;
+ this.type = 'NullLiteral';
+ this.original = this.value = null;
+ },
+
Hash: function(pairs, locInfo) {
this.loc = locInfo;
this.type = 'Hash';