<?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>159257</bug_id>
          
          <creation_ts>2016-06-29 03:48:09 -0700</creation_ts>
          <short_desc>console.log doesn&apos;t display object correctly if followed by delete</short_desc>
          <delta_ts>2017-07-11 11:57:42 -0700</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>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</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="Rafał Miłecki">zajec5</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>inspector-bugzilla-changes</cc>
    
    <cc>joepeck</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1206353</commentid>
    <comment_count>0</comment_count>
      <attachid>282338</attachid>
    <who name="Rafał Miłecki">zajec5</who>
    <bug_when>2016-06-29 03:48:09 -0700</bug_when>
    <thetext>Created attachment 282338
Test case

If we log object right before deleting one of its properties a wrong version appears in the console.

Example:
var test = {};
test.foo = {};
test.foo.bar = &quot;Lorem ipsum&quot;;
console.log(test);
delete test.foo.bar;

Logged object doesn&apos;t have &quot;bar&quot; property when using:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.21 (KHTML, like Gecko) rekonq/2.3.2 Safari/537.21

In the past we already had some problem with displaying objects with console.log (#35801) it looks like similar issue (does it help to find a solution?).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1206617</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2016-06-29 20:04:26 -0700</bug_when>
    <thetext>&lt;rdar://problem/27097304&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1206618</commentid>
    <comment_count>2</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2016-06-29 20:10:26 -0700</bug_when>
    <thetext>This is expected behavior.

When Web Inspector is open, it provides a preview/snapshot of what the object was that was logged in case the object changes.

For large objects, when expanded, you see the live, current data. But for simple objects, when logged, we provide the snapshots.

In this particular case, you logged a simple JSON stringifyable object, and the console message includes the complete description of the object at the time it was logged. That would be what I expect.

Is this causing you an issue in some more realistic situation?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1206619</commentid>
    <comment_count>3</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2016-06-29 20:12:16 -0700</bug_when>
    <thetext>To expand on my last comment.

When Web Inspector is closed, it does not do this previewing/snapshotting behavior. The performance overhead of console methods is a minimum when Web Inspector is closed.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>282338</attachid>
            <date>2016-06-29 03:48:09 -0700</date>
            <delta_ts>2016-06-29 03:48:09 -0700</delta_ts>
            <desc>Test case</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>384</size>
            <attacher name="Rafał Miłecki">zajec5</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgoJPGhlYWQ+CgkJPG1ldGEgY2hhcnNldD0iVVRGLTgiIC8+
CgkJPHRpdGxlPmNvbnNvbGUubG9nIGFuZCBkZWxldGU8L3RpdGxlPgoJPC9oZWFkPgoJPGJvZHk+
CgkJPHA+T3BlbiBicm93c2VyIGNvbnNvbGUuIFlvdSBzaG91bGQgc2VlIGZvbGxvd2luZyBvYmpl
Y3QgdGhlcmU6PC9wPgoJCTxwcmU+ewoJZm9vOiB7CgkJYmFyOiAiTG9yZW0gaXBzdW0iCgl9Cn08
L3ByZT4KCQk8c2NyaXB0PgoJCXZhciB0ZXN0ID0ge307CgkJdGVzdC5mb28gPSB7fTsKCQl0ZXN0
LmZvby5iYXIgPSAiTG9yZW0gaXBzdW0iOwoJCWNvbnNvbGUubG9nKHRlc3QpOwoJCWRlbGV0ZSB0
ZXN0LmZvby5iYXI7CgkJPC9zY3JpcHQ+Cgk8L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>