<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>143650</bug_id>
          
          <creation_ts>2015-04-12 14:23:51 -0700</creation_ts>
          <short_desc>Web Inspector: ObjectTree Property Path doesn&apos;t work for objects logged via console.log</short_desc>
          <delta_ts>2016-12-13 15:34:29 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brian Burg">burg</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>inspector-bugzilla-changes</cc>
    
    <cc>jonowells</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1084694</commentid>
    <comment_count>0</comment_count>
    <who name="Brian Burg">burg</who>
    <bug_when>2015-04-12 14:23:51 -0700</bug_when>
    <thetext>it returns bogus paths, using `this` as the root expression.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1084695</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2015-04-12 14:24:00 -0700</bug_when>
    <thetext>&lt;rdar://problem/20513381&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1084753</commentid>
    <comment_count>2</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2015-04-13 01:44:05 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; it returns bogus paths, using `this` as the root expression.

This is currently expected behavior. &quot;this&quot; is the default when we don&apos;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&apos;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;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1084782</commentid>
    <comment_count>3</comment_count>
    <who name="Brian Burg">burg</who>
    <bug_when>2015-04-13 07:00:48 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (In reply to comment #0)
&gt; &gt; it returns bogus paths, using `this` as the root expression.
&gt; 
&gt; This is currently expected behavior. &quot;this&quot; is the default when we don&apos;t
&gt; know the value.
&gt; 
&gt; - Is there a specific case you have in mind that you think we should improve?
&gt; - Do you think there would be a better default name then &quot;this&quot;?

Well, since the logged object can be previewed, why can&apos;t we give it a $n binding? It was just confusing to me why some expandable (remote?) objects were given numbers and others aren&apos;t. If its not possible to bind, maybe call it /(value)/ instead of `this`.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1084783</commentid>
    <comment_count>4</comment_count>
    <who name="Brian Burg">burg</who>
    <bug_when>2015-04-13 07:02:08 -0700</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; (In reply to comment #0)
&gt; &gt; &gt; it returns bogus paths, using `this` as the root expression.
&gt; &gt; 
&gt; &gt; This is currently expected behavior. &quot;this&quot; is the default when we don&apos;t
&gt; &gt; know the value.
&gt; &gt; 
&gt; &gt; - Is there a specific case you have in mind that you think we should improve?
&gt; &gt; - Do you think there would be a better default name then &quot;this&quot;?
&gt; 
&gt; Well, since the logged object can be previewed, why can&apos;t we give it a $n
&gt; binding? It was just confusing to me why some expandable (remote?) objects
&gt; were given numbers and others aren&apos;t. If its not possible to bind, maybe
&gt; call it /(value)/ instead of `this`.

And if this would create too many $n bindings, then maybe assign a new one when the object is expanded or right-clicked (or other user interaction to hint a shortcut might be useful).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1084845</commentid>
    <comment_count>5</comment_count>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2015-04-13 09:59:59 -0700</bug_when>
    <thetext>Yes, there is concern about too many objects getting $n assignments. Also, what object gets signed for console.log(&quot;message %o&quot;, foo, bar, baz), etc.

Doing it on expend is interesting, but might still be mysterious to users.

You can get a $n for a logged object by using the &quot;Log Value&quot; context menu item.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1084847</commentid>
    <comment_count>6</comment_count>
    <who name="Brian Burg">burg</who>
    <bug_when>2015-04-13 10:02:53 -0700</bug_when>
    <thetext>(In reply to comment #5)
&gt; You can get a $n for a logged object by using the &quot;Log Value&quot; context menu
&gt; item.

OH! I had no idea. Maybe this could be exposed in the UI better:

Show &apos; = [eye]&apos; as the binding (like for getters), and when the eye is clicked, turn it into an $n. I don&apos;t know that an eye is the best glyph... :) Then, logging a path can automatically click the eye.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>