Bug 65532 - Web Inspector: [JSC] //@ sourceURL is not respected.
Summary: Web Inspector: [JSC] //@ sourceURL is not respected.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Podivilov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-02 05:58 PDT by Pavel Feldman
Modified: 2012-01-12 09:07 PST (History)
13 users (show)

See Also:


Attachments
Patch (6.69 KB, patch)
2012-01-12 08:40 PST, Pavel Podivilov
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2011-08-02 05:58:29 PDT
Type eval("window.ff = (function foo() { debugger; }) //@ sourceURL = foo.js") in console.
Expected: new script in the debugger scripts drop down
Actual: no scripts.
Comment 1 Kris Kowal 2012-01-06 15:44:25 PST
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
Comment 2 Kris Kowal 2012-01-11 13:16:24 PST
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.
Comment 3 Patrick Mueller 2012-01-12 05:39:53 PST
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.
Comment 4 Patrick Mueller 2012-01-12 07:46:17 PST
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
Comment 5 Pavel Podivilov 2012-01-12 08:40:49 PST
Created attachment 122252 [details]
Patch
Comment 6 Yury Semikhatsky 2012-01-12 08:49:31 PST
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.
Comment 7 Pavel Podivilov 2012-01-12 09:07:29 PST
Committed r104831: <http://trac.webkit.org/changeset/104831>