Bug 152280

Summary: Web Inspector: Stack traces in console incorrectly show "(anonymous function)" for global code
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Severity: Normal CC: agomez, bburg, commit-queue, graouts, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Description Flags
[PATCH] Proposed Fix
[IMAGE] Before
[IMAGE] After none

Description Joseph Pecoraro 2015-12-14 16:10:39 PST
Stack traces in console incorrectly show "(anonymous function)" for global code.

function foo() { bar(); }
function bar() { console.trace(); }

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
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 BJ 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


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.