BorisMoore/jsrender — pull request #104 by patmoore (2012-03-30 01:53:37+00:00)
Title: If the template expands to bad javascript,

provide a message that show the bad expansion to the user for them to debug.

Previously the user would see a SyntaxError from this line :
code = new Function( "data, view, j, b, u", fnDeclStr
+ (getsValue ? "v," : "")
+ (hasTag ? "t=j.tag," : "")
+ (hasConverter ? "c=j.convert," : "")
+ (hasEncoder ? "e=j.converters.html," : "")
+ "ret; try{\n\n"
+ (tmplOptions.debug ? "debugger;" : "")
+ (allowCode ? 'ret=' : 'return ')
+ code.slice( 0, -1 ) + ";\n\n"
+ (allowCode ? "return ret;" : "")
+ "}catch(e){return j.err(e);}";

which is misleading because the natural inclination is to think that jsrender.js has a syntax error.

The user is shown the expanded problematic template as well.