Bug 81031 - Web Inspector: MainScriptMapping should detect snippet scripts by means of sourceURL set before evaluation.
: Web Inspector: MainScriptMapping should detect snippet scripts by means of so...
Status: RESOLVED FIXED
: WebKit
Web Inspector (Deprecated)
: 528+ (Nightly build)
: All All
: P2 Normal
Assigned To:
:
:
:
: 75094
  Show dependency treegraph
 
Reported: 2012-03-13 13:37 PST by
Modified: 2012-03-15 11:27 PST (History)


Attachments
Patch (19.62 KB, patch)
2012-03-14 12:58 PST, Vsevolod Vlasov
no flags Review Patch | Details | Formatted Diff | Diff
Patch (19.87 KB, patch)
2012-03-14 13:01 PST, Vsevolod Vlasov
no flags Review Patch | Details | Formatted Diff | Diff
Patch (20.11 KB, patch)
2012-03-15 09:15 PST, Vsevolod Vlasov
no flags Review Patch | Details | Formatted Diff | Diff
Patch (20.07 KB, patch)
2012-03-15 10:17 PST, Vsevolod Vlasov
pfeldman: review+
Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2012-03-13 13:37:04 PST
MainScriptMapping should detect snippet scripts by means of sourceURL set before evaluation.
------- Comment #1 From 2012-03-14 12:58:41 PST -------
Created an attachment (id=131901) [details]
Patch
------- Comment #2 From 2012-03-14 13:01:17 PST -------
Created an attachment (id=131902) [details]
Patch
------- Comment #3 From 2012-03-14 16:06:40 PST -------
podivilov@, could you please take a look?
------- Comment #4 From 2012-03-15 02:27:06 PST -------
(From update of attachment 131902 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=131902&action=review

> Source/WebCore/inspector/front-end/SnippetsModel.js:140
> +        var sourceURL = this.sourceURLForSnippet(snippet, evaluationIndex);

Please inline sourceURLForSnippet here and set snippet.sourceURL = sourceURL.

> Source/WebCore/inspector/front-end/SnippetsModel.js:153
> +        for (var i = 0; i < this._snippets.length; ++i) {

Why not making this._snippets a map?

> Source/WebCore/inspector/front-end/SnippetsModel.js:192
> +        var snippetId = this.snippetIdForSourceURL(sourceURL);

Please inline snippetIdForSourceURL here.

> Source/WebCore/inspector/front-end/SnippetsModel.js:240
> +    get lastEvaluationSourceURL()

Please remove this public getter, all you need is a private field that is used solely by SnippetModel.

> Source/WebCore/inspector/front-end/SnippetsModel.js:414
> +        uiSourceCode.snippet = snippet;

This looks wrong.
------- Comment #5 From 2012-03-15 09:15:10 PST -------
Created an attachment (id=132060) [details]
Patch
------- Comment #6 From 2012-03-15 10:12:20 PST -------
(From update of attachment 132060 [details])
View in context: https://bugs.webkit.org/attachment.cgi?id=132060&action=review

looks good!

> Source/WebCore/inspector/front-end/SnippetsModel.js:153
>      snippetIdForSourceURL: function(sourceURL)

Please make it private.
------- Comment #7 From 2012-03-15 10:17:21 PST -------
Created an attachment (id=132068) [details]
Patch
------- Comment #8 From 2012-03-15 10:46:00 PST -------
> > Source/WebCore/inspector/front-end/SnippetsModel.js:153
> >      snippetIdForSourceURL: function(sourceURL)
> 
> Please make it private.

It is used in MainScriptMapping to detect snippet scripts.
------- Comment #9 From 2012-03-15 11:27:02 PST -------
Committed r110864: <http://trac.webkit.org/changeset/110864>