Bug 1310630 - Pass a createLongStringClient prop to the ObjectInspector; r=bgrins. draft
authorNicolas Chevobbe <nchevobbe@mozilla.com>
Mon, 16 Apr 2018 11:32:29 +0200
changeset 785595 2491f4b792554a0c672a3ec0df3fbbabb0cc248e
parent 785449 9c0f8fe684f5a23f02cb8139969dd145e2c30152
child 785606 f045768c90fe8ea50b2665a33395e78f03985f1b
child 785610 87c054b465a8fc94b29691cf7a5e72902d1baa1f
push id107263
push userbmo:nchevobbe@mozilla.com
push dateFri, 20 Apr 2018 12:17:36 +0000
reviewersbgrins
bugs1310630, 1403448
milestone61.0a1
Bug 1310630 - Pass a createLongStringClient prop to the ObjectInspector; r=bgrins. This will allow long strings to be expanded. Tests will be added per Bug 1403448. MozReview-Commit-ID: CUUN6uWTMDF
devtools/client/webconsole/utils/object-inspector.js
--- a/devtools/client/webconsole/utils/object-inspector.js
+++ b/devtools/client/webconsole/utils/object-inspector.js
@@ -1,16 +1,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const { createFactory } = require("devtools/client/shared/vendor/react");
 const ObjectClient = require("devtools/shared/client/object-client");
+const LongStringClient = require("devtools/shared/client/long-string-client");
 
 const reps = require("devtools/client/shared/components/reps/reps");
 const { REPS, MODE } = reps;
 const ObjectInspector = createFactory(reps.ObjectInspector);
 const { Grip } = REPS;
 
 /**
  * Create and return an ObjectInspector for the given grip.
@@ -52,16 +53,18 @@ function getObjectInspector(grip, servic
     roots: [{
       path: (grip && grip.actor) || JSON.stringify(grip),
       contents: {
         value: grip
       }
     }],
     createObjectClient: object =>
       new ObjectClient(serviceContainer.hudProxy.client, object),
+    createLongStringClient: object =>
+      new LongStringClient(serviceContainer.hudProxy.client, object),
     releaseActor: actor => {
       if (!actor || !serviceContainer.hudProxy.releaseActor) {
         return;
       }
       serviceContainer.hudProxy.releaseActor(actor);
     },
     onViewSourceInDebugger: serviceContainer.onViewSourceInDebugger,
     openLink: serviceContainer.openLink,