Bug 1263404 - Fix condition in hasChildren. r=jryans
authorJan Odvarko <odvarko@gmail.com>
Wed, 04 May 2016 14:56:43 +0200
changeset 296378 2451d15ff23433445b43eee9ceb565b7d8750029
parent 296377 ec7b54a0d8125df63b6c11a36e35941a9d81ac31
child 296379 ce2501a5f268283105549cc5316a35ca938c099f
push id76311
push usercbook@mozilla.com
push dateFri, 06 May 2016 12:26:12 +0000
treeherdermozilla-inbound@84a3e5716801 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1263404
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1263404 - Fix condition in hasChildren. r=jryans
devtools/client/jsonview/components/json-panel.js
devtools/client/jsonview/test/browser_jsonview_filter.js
devtools/client/shared/components/tree/object-provider.js
--- a/devtools/client/jsonview/components/json-panel.js
+++ b/devtools/client/jsonview/components/json-panel.js
@@ -109,17 +109,17 @@ define(function (require, exports, modul
       if (this.props.jsonTextLength <= AUTO_EXPAND_MAX_SIZE) {
         expandedNodes = this.getExpandedNodes(this.props.data);
       }
 
       // Render tree component.
       return TreeView({
         object: this.props.data,
         mode: "tiny",
-        onFilter: this.onFilter.bind(this),
+        onFilter: this.onFilter,
         columns: columns,
         renderValue: this.renderValue,
         expandedNodes: expandedNodes,
       });
     },
 
     render: function () {
       let content;
--- a/devtools/client/jsonview/test/browser_jsonview_filter.js
+++ b/devtools/client/jsonview/test/browser_jsonview_filter.js
@@ -8,21 +8,21 @@
 const TEST_JSON_URL = URL_ROOT + "array_json.json";
 
 add_task(function* () {
   info("Test valid JSON started");
 
   yield addJsonViewTab(TEST_JSON_URL);
 
   let count = yield getElementCount(".jsonPanelBox .treeTable .treeRow");
-  is(count, 3, "There must be three rows");
+  is(count, 6, "There must be expected number of rows");
 
   // XXX use proper shortcut to focus the filter box
   // as soon as bug Bug 1178771 is fixed.
   yield sendString("h", ".jsonPanelBox .searchBox");
 
   // The filtering is done asynchronously so, we need to wait.
   yield waitForFilter();
 
   let hiddenCount = yield getElementCount(
     ".jsonPanelBox .treeTable .treeRow.hidden");
-  is(hiddenCount, 2, "There must be two hidden rows");
+  is(hiddenCount, 4, "There must be expected number of hidden rows");
 });
--- a/devtools/client/shared/components/tree/object-provider.js
+++ b/devtools/client/shared/components/tree/object-provider.js
@@ -50,17 +50,17 @@ define(function(require, exports, module
       if (typeof object == "string") {
         return false;
       }
 
       if (typeof object !== "object") {
         return false;
       }
 
-      return Object.keys(object).length > 1;
+      return Object.keys(object).length > 0;
     },
 
     getLabel: function(object) {
       return (object instanceof ObjectProperty) ?
         object.name : null;
     },
 
     getValue: function(object) {