Bug 157852
Summary: | Web Inspector: console.trace should show something useful for bound functions | ||
---|---|---|---|
Product: | WebKit | Reporter: | Blaze Burg <bburg> |
Component: | Web Inspector | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | graouts, inspector-bugzilla-changes, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | All | ||
OS: | All |
Blaze Burg
Currently it just says [native code] as the location and doesn't try to walk up the stack any further. This is annoying.
Since console.trace has a fairly compact format, we probably just want to list the bound function's source location, and continue up the call stack to show which source location called the bound function.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/26349545>
Joseph Pecoraro
* TEST
<script>
function foo() {
bar.bind(null)();
}
function bar() {
console.trace("inner");
}
foo();
</script>
I get:
[Log] Trace: inner
[f] bar (bound.html:6)
[N] bar
[f] foo (bound.html:3)
[S] Global Code (bound.html:8)
So, console.trace does not stop at bound functions.
It doesn't provide a location. It could provide a location. What location should it be? The location of where the function was bound (.bind() invocation), or the location of the target function (that is already available as the next call frame).
Honestly I would have expected this:
[Log] Trace: inner
[f] bar (bound.html:6)
[N] bound bar
[f] foo (bound.html:3)
[S] Global Code (bound.html:8)
We can probably trivially get the improved "bound bar" name when creating the trace frames.