You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lets say we put a breakpoint on the console.log(x) line in module.js. Once we pause we don't have the surrounding scope information of static log(x). E.g. we don't know that the function was inside the Logger class scope, which in turn was in a module scope. We could make MODULE_CONSTANT and CLASS_CONSTANT available via bindings, but a debuggers scope view would have to make it look like those two were defined inside the static log(x) scope.
The only solution I could come up with is to include the scope trees of each original source file as well (similar to how DWARF does it). But I'm curious what folks think.
From a DevTools/debugger perspective this info would be very much needed. Parsing the original sources and constructing a scope tree is not enough (missing bindings info).
The text was updated successfully, but these errors were encountered:
I think there's a misunderstanding here: the proposal calls for including all the original scopes containing the original location. So the function scope for log(), the class scope for Logger and the module scope for module.js would be included.
In this example the sourcemap should include the following scopes for the console.log(42); statement:
the module scope for inline_across_modules.js
the function scope for outer
the function scope for inner
the function scope for log
the class scope for Logger
the module scope for module.js
All of these scopes except the module scope for inline_across_modules.js would have to be repeated for the console.log(null); statement, so explicitly encoding original scopes (like in #62) could be more efficient.
Live example here: https://szuend.github.io/scope-proposal-examples/05_inline_across_modules/inline_across_modules.html
Given the following example:
module.js
inline_across_modules.js
with bundle.js
produced by Closure JS via
Lets say we put a breakpoint on the
console.log(x)
line inmodule.js
. Once we pause we don't have the surrounding scope information ofstatic log(x)
. E.g. we don't know that the function was inside theLogger
class scope, which in turn was in a module scope. We could makeMODULE_CONSTANT
andCLASS_CONSTANT
available via bindings, but a debuggers scope view would have to make it look like those two were defined inside thestatic log(x)
scope.The only solution I could come up with is to include the scope trees of each original source file as well (similar to how DWARF does it). But I'm curious what folks think.
From a DevTools/debugger perspective this info would be very much needed. Parsing the original sources and constructing a scope tree is not enough (missing bindings info).
The text was updated successfully, but these errors were encountered: