New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 667286 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Inspector protocol should expose function scopes as Debugger.Scope type

Project Member Reported by jgruber@chromium.org, Nov 21 2016

Issue description

The inspector protocol currently has basic support for inspecting scopes of functions not currently on the call stack through Runtime.getProperties and the internal '[[Scopes]]' value:

{
    "result": {
        "internalProperties": [
            {
                "name": "[[Scopes]]",
                "value": {
                    "className": "Array",
                    "description": "Scopes[3]",
                    "objectId": "{\"injectedScriptId\":1,\"id\":15}",
                    "subtype": "internal#scopeList",
                    "type": "object"
                }
            }
        ],
        "result": [
        [...]
        ]
    }
}

One element of this array:

{
    [...],
    "name": "0",
    "value": {
        "className": "Object",
        "description": "Closure (gen1)",
        "objectId": "{\"injectedScriptId\":1,\"id\":258}",
        "subtype": "internal#scope",
        "type": "object"
    },
    "writable": true
}

In contrast to the Debugger.Scope type (defined in js_protocol.json and used in Debugger.CallFrames during the Debugger.paused event), this format lacks a well-defined type ("script", "global", ...), startLocation and endLocation.

It would be nice to expose these scopes as the Debugger.Scope type.
 
Components: Platform>DevTools>JavaScript
Owner: kozyatinskiy@chromium.org
Status: Assigned (was: Available)
We specifically did it this way, since it fits internal properties quite well, and is not important enough functionality to justify extra protocol methods/types.

Do you have a usecase in mind except for unification with scopes on pause?
My own personal use-case is that accessing function/suspended generator scopes through our new internal debug-wrapper in test/debugger/test-api.js would be much cleaner if they had the same format as scopes on pause.

I guess I don't care too much either way though since the current implementation in test-api.js (which accesses suspended generator scopes through runtime functions) just works. Feel free to close if you don't feel this is necessary.
Project Member

Comment 4 by bugdroid1@chromium.org, Nov 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5928ab42599d65e34760a6c4081fcbf919f8c641

commit 5928ab42599d65e34760a6c4081fcbf919f8c641
Author: jgruber <jgruber@chromium.org>
Date: Tue Nov 22 16:02:53 2016

Mark function-generator-details as NeedsManualRebaseline

BUG= chromium:667286 

Review-Url: https://codereview.chromium.org/2521823004
Cr-Commit-Position: refs/heads/master@{#433877}

[modify] https://crrev.com/5928ab42599d65e34760a6c4081fcbf919f8c641/third_party/WebKit/LayoutTests/TestExpectations

Status: WontFix (was: Assigned)
Project Member

Comment 7 by bugdroid1@chromium.org, Dec 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d13f0d91b1f707e76dd475be962b5813ab7e764b

commit d13f0d91b1f707e76dd475be962b5813ab7e764b
Author: jgruber <jgruber@chromium.org>
Date: Thu Dec 22 13:03:47 2016

Mark function-generator-details as NeedsRebaseline

The relevant change to display scopes for suspended generator objects
has now landed in V8.

BUG= chromium:667286 

Review-Url: https://codereview.chromium.org/2594203003
Cr-Commit-Position: refs/heads/master@{#440398}

[modify] https://crrev.com/d13f0d91b1f707e76dd475be962b5813ab7e764b/third_party/WebKit/LayoutTests/TestExpectations

Sign in to add a comment