Bug 162113 - Web Inspector: Scope sidebar shows "Closure" instead of "Local" when paused in anonymous function
Summary: Web Inspector: Scope sidebar shows "Closure" instead of "Local" when paused i...
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: 2016-09-16 21:43 PDT by Joseph Pecoraro
Modified: 2016-09-19 12:01 PDT (History)
7 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (11.00 KB, patch)
2016-09-16 21:45 PDT, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.