diff --git a/mustache.js b/mustache.js index 55b36c1..cbe7e89 100644 --- a/mustache.js +++ b/mustache.js @@ -30,10 +30,10 @@ var Mustache = function() { */ render_partial: function(name, context, partials) { if(typeof(context[name]) != "object") { - throw({message: "Context for '" + name + "' is not an object."}); + throw("Context for '" + name + "' is not an object."); } if(!partials || !partials[name]) { - throw({message: "No template for partial '" + name + "'."}); + throw("No template for partial '" + name + "'."); } return this.render(partials[name], context[name], partials); }, @@ -169,7 +169,7 @@ var Mustache = function() { } else { src = context.toString(); } - throw({message: "'" + name + "' not found in context: " + src}); + throw("'" + name + "' not found in context: " + src); } ctx = ctx[p]; } diff --git a/test/mustache_spec.rb b/test/mustache_spec.rb index 4bd3ec6..911e1b6 100644 --- a/test/mustache_spec.rb +++ b/test/mustache_spec.rb @@ -34,7 +34,7 @@ describe "mustache" do try { print(Mustache.to_html("{{#list}}{{x}}{{/list}}", {list: [{}]})); } catch(e) { - print('ERROR: ' + e.message); + print('ERROR: ' + e); } JS run_js(js).should == "ERROR: 'x' not found in context: {list:[{}]}\n" @@ -54,7 +54,7 @@ describe "mustache" do var result = Mustache.to_html(template, #{testname}); print(result); } catch(e) { - print('ERROR: ' + e.message); + print('ERROR: ' + e); } JS @@ -79,7 +79,7 @@ describe "mustache" do var result = Mustache.to_html(template, partial_context, partials); print(result); } catch(e) { - print('ERROR: ' + e.message); + print('ERROR: ' + e); } JS