Make compiled templates more debuggable.

Former-commit-id: aba1aa3efcea6695632aae0eb61148aa3174debd
This commit is contained in:
John-David Dalton
2012-07-11 01:52:50 -04:00
parent cbdc9c0be1
commit 2ac887ff74
2 changed files with 14 additions and 1 deletions

View File

@@ -3421,7 +3421,11 @@
text += '\n//@ sourceURL=/lodash/template/source[' + (templateCounter++) + ']';
}
result = Function('_', 'return ' + text)(lodash);
try {
result = Function('_', 'return ' + text)(lodash);
} catch(e) {
result = function() { throw e; };
}
if (data) {
return result(data);