RESOLVED WORKSFORME 159257
console.log doesn't display object correctly if followed by delete
https://bugs.webkit.org/show_bug.cgi?id=159257
Summary console.log doesn't display object correctly if followed by delete
Rafał Miłecki
Reported 2016-06-29 03:48:09 PDT
Created attachment 282338 [details] 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 = "Lorem ipsum"; console.log(test); delete test.foo.bar; Logged object doesn't have "bar" 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?).
Attachments
Test case (384 bytes, text/html)
2016-06-29 03:48 PDT, Rafał Miłecki
no flags
Radar WebKit Bug Importer
Comment 1 2016-06-29 20:04:26 PDT
Joseph Pecoraro
Comment 2 2016-06-29 20:10:26 PDT
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?
Joseph Pecoraro
Comment 3 2016-06-29 20:12:16 PDT
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.
Note You need to log in before you can comment on or make changes to this bug.