Bug 152280 - Web Inspector: Stack traces in console incorrectly show "(anonymous function)" for global code
Summary: Web Inspector: Stack traces in console incorrectly show "(anonymous function)...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-12-14 16:10 PST by Joseph Pecoraro
Modified: 2015-12-14 17:15 PST (History)
9 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (19.12 KB, patch)
2015-12-14 16:13 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff
[IMAGE] Before (66.46 KB, image/png)
2015-12-14 16:13 PST, Joseph Pecoraro
no flags Details
[IMAGE] After (65.38 KB, image/png)
2015-12-14 16:13 PST, Joseph Pecoraro
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-12-14 16:10:39 PST
* SUMMARY
Stack traces in console incorrectly show "(anonymous function)" for global code.

* TEST
<script>
function foo() { bar(); }
function bar() { console.trace(); }
foo();
</script>

* STEPS TO REPRODUCE
1. Open test case
2. Show Console in inspector
  => trace output lists "(anonymous function)" at global code level. This is wrong / incorrect.
Comment 1 Radar WebKit Bug Importer 2015-12-14 16:11:40 PST
<rdar://problem/23891615>
Comment 2 Joseph Pecoraro 2015-12-14 16:13:02 PST
Created attachment 267324 [details]
[PATCH] Proposed Fix
Comment 3 Joseph Pecoraro 2015-12-14 16:13:14 PST
Created attachment 267325 [details]
[IMAGE] Before
Comment 4 Joseph Pecoraro 2015-12-14 16:13:26 PST
Created attachment 267327 [details]
[IMAGE] After
Comment 5 Brian Burg 2015-12-14 16:26:56 PST
Comment on attachment 267324 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=267324&action=review

r=me

I will note for posterity that I don't like the name "program" for a top-level evaluation. I prefer (evaluation), (module evaluation), (global evaluation), etc. If we had a fake call frame for the vm entry method (rAF, parsing, events, etc) then we could use that as the "program" call frame in the UI.

> Source/WebInspectorUI/UserInterface/Models/CallFrame.js:135
> +        var functionName = payload.functionName;

Nit: let
Comment 6 WebKit Commit Bot 2015-12-14 17:14:59 PST
Comment on attachment 267324 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 267324

Committed r194083: <http://trac.webkit.org/changeset/194083>
Comment 7 WebKit Commit Bot 2015-12-14 17:15:03 PST
All reviewed patches have been landed.  Closing bug.