NEW 157852
Web Inspector: console.trace should show something useful for bound functions
https://bugs.webkit.org/show_bug.cgi?id=157852
Summary Web Inspector: console.trace should show something useful for bound functions
Blaze Burg
Reported 2016-05-18 11:28:53 PDT
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
Radar WebKit Bug Importer
Comment 1 2016-05-18 11:30:57 PDT
Joseph Pecoraro
Comment 2 2016-05-18 11:54:13 PDT
* 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.
Note You need to log in before you can comment on or make changes to this bug.