summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/compiler.js
diff options
context:
space:
mode:
authorkpdecker <kpdecker@gmail.com>2015-08-22 10:57:24 -0700
committerkpdecker <kpdecker@gmail.com>2015-08-22 10:58:44 -0700
commit2571dd8e8e43fd320672763564b16a5b3ae33966 (patch)
treeb3cdd821bc239f9c57d2bf2b090c7191b09494fb /lib/handlebars/compiler/compiler.js
parent729d9fdffe92d7fbe9e5b2aa3fc46c2b1632683a (diff)
downloadhandlebars.js-2571dd8e8e43fd320672763564b16a5b3ae33966.zip
handlebars.js-2571dd8e8e43fd320672763564b16a5b3ae33966.tar.gz
handlebars.js-2571dd8e8e43fd320672763564b16a5b3ae33966.tar.bz2
Improve sanity checks in compiler and visitor
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r--lib/handlebars/compiler/compiler.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js
index c8db7c9..ad6b861 100644
--- a/lib/handlebars/compiler/compiler.js
+++ b/lib/handlebars/compiler/compiler.js
@@ -90,6 +90,11 @@ Compiler.prototype = {
},
accept: function(node) {
+ /* istanbul ignore next: Sanity code */
+ if (!this[node.type]) {
+ throw new Exception('Unknown type: ' + node.type, node);
+ }
+
this.sourceNode.unshift(node);
let ret = this[node.type](node);
this.sourceNode.shift();