<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Web Inspector: ObjectTree Property Path doesn't work for objects logged via console.log"
href="https://bugs.webkit.org/show_bug.cgi?id=143650#c2">Comment # 2</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Web Inspector: ObjectTree Property Path doesn't work for objects logged via console.log"
href="https://bugs.webkit.org/show_bug.cgi?id=143650">bug 143650</a>
from <span class="vcard"><a class="email" href="mailto:joepeck@webkit.org" title="Joseph Pecoraro <joepeck@webkit.org>"> <span class="fn">Joseph Pecoraro</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=143650#c0">comment #0</a>)
<span class="quote">> it returns bogus paths, using `this` as the root expression.</span >
This is currently expected behavior. "this" is the default when we don't know the value.
Unless the value is a $n value (or the special case of top level names in the Scope Chain Sidebar) we don't know how to reference the top level object.
Take this for example:
console.log([a:1});
console.log(functionReturningObject());
There is no reference to those objects. So we say "this".
However for:
js> obj = {a:1}; dir(obj)
{a: 1} = $1
In this case, we know the root level object is $1 and can use that.
If someone does:
console.log(event);
By the time the event has passed, if we showed "event.type" as the property path that could be misleading if "event" no longer refers to the event at the time it was logged.
--
- Is there a specific case you have in mind that you think we should improve?
- Do you think there would be a better default name then "this"?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>