Bug 1295491 - Remove Reference component in grip-array.js. r=Honza
authorEvan Tseng <evan@tseng.io>
Tue, 16 Aug 2016 15:35:33 +0800
changeset 310136 457c3fe90f5ff7359fd90d6ed31524eab822b418
parent 310135 5e10edf2ce87b40df535839d157d60681c915891
child 310137 dce857dd57e2d91ae4c6014cf21e93ef95e4dd36
push id31532
push userryanvm@gmail.com
push dateFri, 19 Aug 2016 13:59:01 +0000
treeherderautoland@4f1e241f75a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1295491
milestone51.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 1295491 - Remove Reference component in grip-array.js. r=Honza
devtools/client/shared/components/reps/grip-array.js
devtools/client/shared/components/test/mochitest/test_reps_grip-array.html
--- a/devtools/client/shared/components/reps/grip-array.js
+++ b/devtools/client/shared/components/reps/grip-array.js
@@ -64,29 +64,21 @@ define(function (require, exports, modul
 
       for (let i = 0; i < array.length && i < max; i++) {
         try {
           let itemGrip = array[i];
           let value = provider ? provider.getValue(itemGrip) : itemGrip;
 
           delim = (i == delimMax ? "" : ", ");
 
-          if (value === array) {
-            items.push(Reference({
-              key: i,
-              object: value,
-              delim: delim}
-            ));
-          } else {
-            items.push(GripArrayItem(Object.assign({}, this.props, {
-              key: i,
-              object: value,
-              delim: delim}
-            )));
-          }
+          items.push(GripArrayItem(Object.assign({}, this.props, {
+            key: i,
+            object: value,
+            delim: delim}
+          )));
         } catch (exc) {
           items.push(GripArrayItem(Object.assign({}, this.props, {
             object: exc,
             delim: delim,
             key: i}
           )));
         }
       }
@@ -173,31 +165,16 @@ define(function (require, exports, modul
             mode: "tiny"
           })),
           this.props.delim
         )
       );
     }
   }));
 
-  /**
-   * Renders cycle references in an array.
-   */
-  let Reference = React.createFactory(React.createClass({
-    displayName: "Reference",
-
-    render: function () {
-      return (
-        span({title: "Circular reference"},
-          "[…]"
-        )
-      );
-    }
-  }));
-
   function supportsObject(grip, type) {
     if (!isGrip(grip)) {
       return false;
     }
 
     return (grip.preview && grip.preview.kind == "ArrayLike");
   }
 
--- a/devtools/client/shared/components/test/mochitest/test_reps_grip-array.html
+++ b/devtools/client/shared/components/test/mochitest/test_reps_grip-array.html
@@ -156,19 +156,16 @@ window.onload = Task.async(function* () 
         expectedOutput: defaultLongOutput
       }
     ];
 
     testRepRenderModes(modeTests, testName, componentUnderTest, getGripStub(testName));
   }
 
   function testRecursiveArray() {
-    // @TODO This is not how this feature should actually work
-    // See Bug 1282465 - Reps: fix or remove recursive handling in grip-array
-
     // Test array = `let a = []; a = [a]`
     const testName = "testRecursiveArray";
 
     const defaultOutput = `Array[ [1] ]`;
 
     const modeTests = [
       {
         mode: undefined,