[scopes] Resolve original scope chains using source map 'scopes' info
The algorithm to obtain the original scope chain is straight-forward:
1) Find the inner-most generated range that contains the
CallFrame's paused position.
2) Does the found range have an associated original scope?
2a) If no, return null. This is a "hidden" range and technically
we shouldn't be pausing here in the first place.
This code doesn't correspond to anything in the authored code.
2b) If yes, the associated original scope is the inner-most
original scope in the resulting scope chain.
3) Walk the parent chain of the found original scope outwards. This is
our scope view. For each original scope we also try to find a
corresponding generated range that contains the CallFrame's
paused position. We need the generated range to resolve variable
values.
The CL also adds a couple of unit tests to document the existing
behavior and design choices. These might need to be revisited
depending on how source map generators actually choose to emit
scopes.
R=pfaffe@chromium.org
Bug: 40277685
Change-Id: Ia033d3a5f8d1c60be5059c05da770e220940538e
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5833561
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Philip Pfaffe <pfaffe@chromium.org>
The client-side of the Chrome DevTools, including all TypeScript & CSS to run the DevTools webapp.
The frontend is available on chromium.googlesource.com. Check out the Chromium DevTools documentation for instructions to set up, use, and maintain a DevTools front-end checkout, as well as design guidelines, and architectural documentation.
DevTools frontend repository is mirrored on GitHub.
DevTools frontend is also available on NPM as the chrome-devtools-frontend package. It's not currently available via CJS or ES modules, so consuming this package in other tools may require some effort.
The version number of the npm package (e.g. 1.0.373466) refers to the Chromium commit position of latest frontend git commit. It's incremented with every Chromium commit, however the package is updated roughly daily.
There are a few options to keep an eye on the latest and greatest of DevTools development:
Follow What's new in DevTools.
Follow Umar's Dev Tips.
Follow these individual Twitter accounts: @umaar, @malyw, @kdzwinel, @addyosmani, @paul_irish, @samccone, @mathias, @mattzeunert, @PrashantPalikhe, @ziyunfei, and @bmeurer.
Follow to g/devtools-reviews@chromium.org mailing list for all reviews of pending code, and view the log, or follow @DevToolsCommits on Twitter.
Checkout all open DevTools tickets on crbug.com
Use Chrome Canary and poke around the experiments.