| Summary: | Web Inspector: silent failure if introducing local variable in console when debugger paused | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Brian Burg <burg> |
| Component: | Web Inspector | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW --- | ||
| Severity: | Normal | CC: | ggaren, inspector-bugzilla-changes, jonowells, mark.lam, saam, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | 528+ (Nightly build) | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
Brian Burg
2015-02-11 08:21:34 PST
I would expect this to just work while debugging. To work with strict mode we have to make a closure and call eval() inside it while paused in the debugger. http://trac.webkit.org/browser/trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js#L409 The closure captures the var and it is thrown away each time. We could potentially reuse it while paused. But we really just need JSC support to avoid this hack. It we could use with() while in strict mode, then we wouldn't need the closure. So this code has changed a bunch. I believe doing `var x` will work outside of strict mode code. Using `let x` probably won't work in strict or non-strict. And `var` probably won't work in strict mode. If we wanted this to work, we'd probably have to do some really tricky stuff. How do debuggers like lldb make this work? They store the result in a temporary variable, or you can create custom variables. Maybe we could approach this problem from that angle. |