diff options
Diffstat (limited to 'lib/handlebars/compiler/compiler.js')
-rw-r--r-- | lib/handlebars/compiler/compiler.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/handlebars/compiler/compiler.js b/lib/handlebars/compiler/compiler.js index 0d21739..b148bbb 100644 --- a/lib/handlebars/compiler/compiler.js +++ b/lib/handlebars/compiler/compiler.js @@ -538,6 +538,13 @@ Handlebars.JavaScriptCompiler = function() {}; // Perform a second pass over the output to merge content when possible var source = this.mergeSource(); + if (!this.isChild) { + source = "if (Handlebars.VERSION !== '"+Handlebars.VERSION+"') {\n"+ + "throw 'Template was compiled with "+Handlebars.VERSION+", but runtime is '+Handlebars.VERSION;\n"+ + "}\n"+ + source; + } + if (asObject) { params.push(source); |