<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&#64;webkit.org" title="Joseph Pecoraro &lt;joepeck&#64;webkit.org&gt;"> <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">&gt; it returns bogus paths, using `this` as the root expression.</span >

This is currently expected behavior. &quot;this&quot; 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 &quot;this&quot;.

However for:

    js&gt; 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 &quot;event.type&quot; as the property path that could be misleading if &quot;event&quot; 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 &quot;this&quot;?</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>