Bug 141066

Summary: Web Inspector: console.table with columnName filter for non-existent property should still show column
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[IMAGE] Proposed Changes
none
[PATCH] Proposed Fix none

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.