Bug 141066 - Web Inspector: console.table with columnName filter for non-existent property should still show column
Summary: Web Inspector: console.table with columnName filter for non-existent property...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-01-29 18:56 PST by Joseph Pecoraro
Modified: 2015-02-04 14:27 PST (History)
8 users (show)

See Also:


Attachments
[IMAGE] Proposed Changes (68.14 KB, image/png)
2015-02-03 17:20 PST, Joseph Pecoraro
no flags Details
[PATCH] Proposed Fix (7.81 KB, patch)
2015-02-03 17:25 PST, Joseph Pecoraro
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2015-01-29 18:56:41 PST
* SUMMARY
console.table with columnName filter for non-existent property should still show column.

* TEST
var p1 = { first: "Joe", last: "Peck", age: 10 };
var p2 = { first: "First", last: "Last", age: 20 };
console.table([p1, p2], ["first", "age", "middle"]);

* EXPECTED OUTPUT
Table with "(Index)", "first", "age", and "middle" columns.

* ACTUAL OUTPUT
Table with "(Index)", "first", and "age" columns. Since no object had a "middle" property.

* NOTES
- We should probably use the columnNames list as the proposed order of columns.
- We can improve the backend by not getting all property descriptors, and filtering on columnNames earlier / proactively
Comment 1 Radar WebKit Bug Importer 2015-01-29 18:56:55 PST
<rdar://problem/19658214>
Comment 2 Joseph Pecoraro 2015-02-03 17:20:30 PST
Created attachment 245993 [details]
[IMAGE] Proposed Changes
Comment 3 Joseph Pecoraro 2015-02-03 17:25:00 PST
Created attachment 245994 [details]
[PATCH] Proposed Fix

It kinda stinks that we pass this array to the frontend as a RemoteObject. This forces the frontend to peek into the preview to get string values. This could be an optional property on ConsoleMessage, but I felt it might make sense keeping it a "console.table" parameter like a "console.log" parameter. I can go with either approach.
Comment 4 WebKit Commit Bot 2015-02-04 14:27:24 PST
Comment on attachment 245994 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 245994

Committed r179635: <http://trac.webkit.org/changeset/179635>
Comment 5 WebKit Commit Bot 2015-02-04 14:27:28 PST
All reviewed patches have been landed.  Closing bug.