Bug 881480: Add ownSymbols to onPrototypeAndProperties; r?ochameau
MozReview-Commit-ID: 7Mzg1UPOYcY
--- a/devtools/server/actors/object.js
+++ b/devtools/server/actors/object.js
@@ -245,33 +245,41 @@ ObjectActor.prototype = {
},
/**
* Handle a protocol request to provide the prototype and own properties of
* the object.
*/
onPrototypeAndProperties: function () {
let ownProperties = Object.create(null);
+ let ownSymbols = [];
let names;
+ let symbols;
try {
names = this.obj.getOwnPropertyNames();
+ symbols = this.obj.getOwnPropertySymbols();
} catch (ex) {
// The above can throw if this.obj points to a dead object.
// TODO: we should use Cu.isDeadWrapper() - see bug 885800.
return { from: this.actorID,
prototype: this.hooks.createValueGrip(null),
ownProperties: ownProperties,
+ ownSymbols: ownSymbols,
safeGetterValues: Object.create(null) };
}
for (let name of names) {
ownProperties[name] = this._propertyDescriptor(name);
}
+ for (let sym of symbols) {
+ ownSymbols.push({"name": sym.toString(), "descriptor": this._propertyDescriptor(sym)});
+ }
return { from: this.actorID,
prototype: this.hooks.createValueGrip(this.obj.proto),
ownProperties: ownProperties,
+ ownSymbols: ownSymbols,
safeGetterValues: this._findSafeGetterValues(names) };
},
/**
* Find the safe getter values for the current Debugger.Object, |this.obj|.
*
* @private
* @param array ownProperties