Add a sourceURL to the end of eval'd code

This, miraculously, lets Chrome dev tools list tiddler modules in the
script tag by their proper titles. Which lets you set breakpoints
within them!!!!!

https://chromedevtools.googlecode.com/svn-history/r421/trunk/tutorials/b
reapoints/index.html#regular
print-window-tiddler
Jermolene 2014-04-06 22:36:51 +01:00
rodzic c7b4febae3
commit 8a7d0f53d3
1 zmienionych plików z 1 dodań i 1 usunięć

Wyświetl plik

@ -397,7 +397,7 @@ $tw.utils.evalGlobal = function(code,context,filename) {
// Compile the code into a function // Compile the code into a function
var fn; var fn;
if($tw.browser) { if($tw.browser) {
fn = window["eval"](code); fn = window["eval"](code + "\n\n//# sourceURL=" + filename);
} else { } else {
fn = vm.runInThisContext(code,filename); fn = vm.runInThisContext(code,filename);
} }