Bug 162113

Summary: Web Inspector: Scope sidebar shows "Closure" instead of "Local" when paused in anonymous function
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: bburg, commit-queue, joepeck, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2016-09-16 21:43:44 PDT
Summary:
Scope sidebar shows "Closure" instead of "Local" when paused in anonymous function

Test:
<script>
(function f() {
    let a;
    var x;
    debugger;
})();
</script>

Steps to Reproduce:
1. Inspect test page
2. Reload to trigger pause
3. Show Scope sidebar
  => Top scope says "Closure Variables" but should say "Local Variables"

Notes:
- We are comparing the empty string function name against `null` when merging scopes and trying to detect the top as Local
Comment 1 Radar WebKit Bug Importer 2016-09-16 21:44:09 PDT
<rdar://problem/28348954>
Comment 2 Joseph Pecoraro 2016-09-16 21:45:53 PDT
Created attachment 289160 [details]
[PATCH] Proposed Fix
Comment 3 BJ Burg 2016-09-19 03:09:28 PDT
Comment on attachment 289160 [details]
[PATCH] Proposed Fix

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

r=me

> LayoutTests/inspector/debugger/paused-scopes.html:101
> +            WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, (event) => {

Could probably use .awaitEvent(...).then here.
Comment 4 WebKit Commit Bot 2016-09-19 12:01:34 PDT
Comment on attachment 289160 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 289160

Committed r206105: <http://trac.webkit.org/changeset/206105>
Comment 5 WebKit Commit Bot 2016-09-19 12:01:38 PDT
All reviewed patches have been landed.  Closing bug.