 Chromium Code Reviews
 Chromium Code Reviews Issue 2918993003:
  DevTools: allow shallow array values in console.table  (Closed)
    
  
    Issue 2918993003:
  DevTools: allow shallow array values in console.table  (Closed) 
  | Index: third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js | 
| diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js | 
| index 9f25c5e7c80ac0f45434dcc4c46cf5c38f4c1e95..a30ddddc943024ce5443a1c5488da66a587e366a 100644 | 
| --- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js | 
| +++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js | 
| @@ -135,14 +135,18 @@ Console.ConsoleViewMessage = class { | 
| var rows = []; | 
| for (var i = 0; i < preview.properties.length; ++i) { | 
| var rowProperty = preview.properties[i]; | 
| - var rowPreview = rowProperty.valuePreview; | 
| - if (!rowPreview) | 
| + var rowSubProperties; | 
| + if (rowProperty.valuePreview) | 
| + rowSubProperties = rowProperty.valuePreview.properties; | 
| + else if (rowProperty.value) | 
| + rowSubProperties = [{name: Common.UIString('Value'), type: rowProperty.type, value: rowProperty.value}]; | 
| 
dgozman
2017/06/02 22:02:32
This new column could match one of the properties.
 
luoe
2017/06/02 22:18:16
Yeah, I didn't consider that case.  Done.
 | 
| + else | 
| continue; | 
| var rowValue = {}; | 
| const maxColumnsToRender = 20; | 
| - for (var j = 0; j < rowPreview.properties.length; ++j) { | 
| - var cellProperty = rowPreview.properties[j]; | 
| + for (var j = 0; j < rowSubProperties.length; ++j) { | 
| + var cellProperty = rowSubProperties[j]; | 
| var columnRendered = columnNames.indexOf(cellProperty.name) !== -1; | 
| if (!columnRendered) { | 
| if (columnNames.length === maxColumnsToRender) |