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 /lib/handlebars/compiler/compiler.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 'lib/handlebars/compiler/compiler.js')
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index e1b4dfb..a39082d 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -273,6 +273,14 @@ Compiler.prototype = { this.opcode('pushLiteral', bool.value); }, + UndefinedLiteral: function() { + this.opcode('pushLiteral', 'undefined'); + }, + + NullLiteral: function() { + this.opcode('pushLiteral', 'null'); + }, + Hash: function(hash) { var pairs = hash.pairs, i, l; |