Get a better error for compile(falsy)
This commit is contained in:
@@ -1035,6 +1035,10 @@ Handlebars.JavaScriptCompiler = function() {};
|
||||
})(Handlebars.Compiler, Handlebars.JavaScriptCompiler);
|
||||
|
||||
Handlebars.precompile = function(string, options) {
|
||||
if (typeof string !== 'string') {
|
||||
throw new Handlebars.Exception("You must pass a string to Handlebars.compile. You passed " + string);
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
|
||||
var ast = Handlebars.parse(string);
|
||||
@@ -1043,6 +1047,10 @@ Handlebars.precompile = function(string, options) {
|
||||
};
|
||||
|
||||
Handlebars.compile = function(string, options) {
|
||||
if (typeof string !== 'string') {
|
||||
throw new Handlebars.Exception("You must pass a string to Handlebars.compile. You passed " + string);
|
||||
}
|
||||
|
||||
options = options || {};
|
||||
|
||||
var compiled;
|
||||
|
||||
Reference in New Issue
Block a user