Bug 1304352 - Fix title issue in the ObjectRep. r=Honza; draft
authorNicolas Chevobbe <chevobbe.nicolas@gmail.com>
Wed, 28 Sep 2016 07:49:38 +0200
changeset 419035 acce6fd30080ee91b26a24ef45f6c55d29d81167
parent 419033 9baec74b3db1bf005c66ae2f50bafbdb02c3be38
child 419036 6a7de765973a662d43923cb956e8aa25844fb180
child 419384 3868293a10beb9b732d08441b5cfd226d9df929e
push id30831
push userchevobbe.nicolas@gmail.com
push dateThu, 29 Sep 2016 16:16:15 +0000
reviewersHonza
bugs1304352
milestone52.0a1
Bug 1304352 - Fix title issue in the ObjectRep. r=Honza; MozReview-Commit-ID: 2oh8mZ4zE2b
devtools/client/shared/components/reps/object.js
--- a/devtools/client/shared/components/reps/object.js
+++ b/devtools/client/shared/components/reps/object.js
@@ -22,22 +22,23 @@ define(function (require, exports, modul
     displayName: "Obj",
 
     propTypes: {
       object: React.PropTypes.object,
       mode: React.PropTypes.string,
     },
 
     getTitle: function (object) {
+      let className = object && object.class ? object.class : "Object";
       if (this.props.objectLink) {
         return this.props.objectLink({
           object: object
-        }, object.class);
+        }, className);
       }
-      return "Object";
+      return className;
     },
 
     safePropIterator: function (object, max) {
       max = (typeof max === "undefined") ? 3 : max;
       try {
         return this.propIterator(object, max);
       } catch (err) {
         console.error(err);
@@ -134,17 +135,17 @@ define(function (require, exports, modul
     render: function () {
       let object = this.props.object;
       let props = this.safePropIterator(object);
       let objectLink = this.props.objectLink || span;
 
       if (this.props.mode == "tiny" || !props.length) {
         return (
           span({className: "objectBox objectBox-object"},
-            objectLink({className: "objectTitle"}, this.getTitle())
+            objectLink({className: "objectTitle"}, this.getTitle(object))
           )
         );
       }
 
       return (
         span({className: "objectBox objectBox-object"},
           this.getTitle(object),
           objectLink({