Type eval("window.ff = (function foo() { debugger; }) //@ sourceURL = foo.js") in console. Expected: new script in the debugger scripts drop down Actual: no scripts.
I can confirm that this issues exists with Safari 5.1. This is an apt reduction of the general problem that programs using XHR+eval code loaders are not presently debuggable in Safari, but Chrome is fine. There are related comments here https://bugs.webkit.org/show_bug.cgi?id=57454
At https://bugs.webkit.org/show_bug.cgi?id=38662 > [sourceURL handling code] became dead when we stopped pushing script source to frontend to make loading faster. SourceURL values are now extracted on backend side by JS engine. It was implemented in V8 but not in JSC.
It doesn't appear anyone is working on this. I have an interest, but could use some hints. First thing I'd need to do is to make sure this fixable in WebKit code (which I can fix) and not Safari code (which I can't). Then pointers to how to fix this would be useful, but I can likely figure it out myself if no one else knows.
Got a Twitter message from tobie to not repeat the mistake found here, when implementing this. Not sure if it's appropriate or not, but figured I'd post it here just in case: http://code.google.com/p/chromium/issues/detail?id=109362
Created attachment 122252 [details] Patch
Comment on attachment 122252 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=122252&action=review > Source/WebCore/bindings/js/ScriptDebugServer.cpp:240 > + script.url = ContentSearchUtils::findSourceURL(script.source); We may want to use it for both engines for consistency.
Committed r104831: <http://trac.webkit.org/changeset/104831>