inspector protocol should expose eval scopes |
||
Issue description
From the mail thread:
Scopes in the inspector protocol seem to be missing the 'eval' scope type (Debug.ScopeType.Eval). We'd need these for a couple of our internal tests (e.g. debug-eval-scope.js), and they should probably also show up in DevTools. Do you have any plans to add eval scopes to the protocol? To DevTools? If you like, I can look into adding it to the protocol in the next couple of days.
Secondly, we recently added support for accessing the scopes of suspended generator objects in 4cff8218. So far, we cannot use this through inspector, since inspector only sends Scopes on the Debugger.paused event (and any generator on the callstack is not suspended). Do you have any ideas about adding access to suspended generator's scopes to inspector (and DevTools)? Is this something that could be added in the short-term?
Apparently eval scopes exist for strict mode:
d8> eval("'use strict'; var x = 42;")
"use strict"
d8> x
(d8):1: ReferenceError: x is not defined
See also http://stackoverflow.com/questions/9781285/specify-scope-for-eval-in-javascript.
We have a couple of examples in our tests:
test/mjsunit/debug-eval-scope.js: assertEquals([ debug.ScopeType.Eval,
test/mjsunit/es6/debug-scope-default-param-with-eval.js: assertEquals([ debug.ScopeType.Eval,
test/mjsunit/regress/regress-5207.js: assertEquals(debug.ScopeType.Eval, scopes[0].scopeType());
,
Nov 21 2016
I have a CL in flight for this: https://codereview.chromium.org/2519773003
,
Nov 23 2016
The following revision refers to this bug: https://chromium.googlesource.com/v8/v8.git/+/0dcc7a0e209f10f88735cb51c4ae0ec32ba183ba commit 0dcc7a0e209f10f88735cb51c4ae0ec32ba183ba Author: jgruber <jgruber@chromium.org> Date: Wed Nov 23 07:30:01 2016 [debug] Add Eval scope type to inspector protocol BUG= v8:5530 , chromium:667218 Review-Url: https://codereview.chromium.org/2519773003 Cr-Commit-Position: refs/heads/master@{#41205} [modify] https://crrev.com/0dcc7a0e209f10f88735cb51c4ae0ec32ba183ba/src/inspector/debugger-script.js [modify] https://crrev.com/0dcc7a0e209f10f88735cb51c4ae0ec32ba183ba/src/inspector/debugger_script_externs.js [modify] https://crrev.com/0dcc7a0e209f10f88735cb51c4ae0ec32ba183ba/src/inspector/injected-script-source.js [modify] https://crrev.com/0dcc7a0e209f10f88735cb51c4ae0ec32ba183ba/src/inspector/js_protocol.json [rename] https://crrev.com/0dcc7a0e209f10f88735cb51c4ae0ec32ba183ba/test/debugger/debug/debug-eval-scope.js [rename] https://crrev.com/0dcc7a0e209f10f88735cb51c4ae0ec32ba183ba/test/debugger/debug/debug-evaluate-locals-optimized-double.js [rename] https://crrev.com/0dcc7a0e209f10f88735cb51c4ae0ec32ba183ba/test/debugger/debug/regress-5207.js [modify] https://crrev.com/0dcc7a0e209f10f88735cb51c4ae0ec32ba183ba/test/debugger/test-api.js [add] https://crrev.com/0dcc7a0e209f10f88735cb51c4ae0ec32ba183ba/test/inspector/debugger/eval-scopes-expected.txt [add] https://crrev.com/0dcc7a0e209f10f88735cb51c4ae0ec32ba183ba/test/inspector/debugger/eval-scopes.js
,
Nov 23 2016
|
||
►
Sign in to add a comment |
||
Comment 1 by jgruber@chromium.org
, Nov 21 2016