1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 18:17:20 +00:00

Better error messages for eval'd code

This commit is contained in:
Jeremy Ruston 2012-01-17 15:35:13 +00:00
parent a6de27b348
commit ca3778f9fd

View File

@ -320,8 +320,11 @@ WikiStore.prototype.compileTiddler = function(title,type) {
});
if(tiddler) {
if(!renderers[type]) {
var tree = this.parseTiddler(title);
renderers[type] = eval(tree.compile(type));
var tree = this.parseTiddler(title),
text = tree.compile(type);
// Add a source URL to help debugging (see http://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/)
text += "//@ sourceURL=" + encodeURIComponent(title) + "-" + type;
renderers[type] = eval(text);
}
return renderers[type];
} else {