Bug 934163 - Use Cu.isDeadWrapper in objectDescriptor; r=past
authorNick Fitzgerald <fitzgen@gmail.com>
Mon, 25 Nov 2013 10:31:46 -0800
changeset 157493 2c71d40fbee0ce1d35c54d77bf5daff85020ed21
parent 157492 401bba5f86948b72a8a54bae813a91e1bcc16208
child 157494 0e0787161168d8380013b7612838fb28fb67767a
push id25714
push usercbook@mozilla.com
push dateTue, 26 Nov 2013 11:39:03 +0000
treeherdermozilla-central@4a8c40940659 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs934163
milestone28.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 934163 - Use Cu.isDeadWrapper in objectDescriptor; r=past
toolkit/devtools/server/actors/tracer.js
--- a/toolkit/devtools/server/actors/tracer.js
+++ b/toolkit/devtools/server/actors/tracer.js
@@ -639,28 +639,25 @@ function objectGrip(aObject) {
  * ownProperties, and safeGetterValues properties.
  *
  * @param aObject Debugger.Object
  *        The object to describe with the created descriptor.
  */
 function objectDescriptor(aObject) {
   let desc = objectGrip(aObject);
   let ownProperties = Object.create(null);
-  let names;
-  try {
-    names = aObject.getOwnPropertyNames();
-  } catch(ex) {
-    // The above can throw if aObject points to a dead object.
-    // TODO: we should use Cu.isDeadWrapper() - see bug 885800.
+
+  if (Cu.isDeadWrapper(aObject)) {
     desc.prototype = createValueGrip(null);
     desc.ownProperties = ownProperties;
     desc.safeGetterValues = Object.create(null);
     return desc;
   }
 
+  const names = aObject.getOwnPropertyNames();
   let i = 0;
   for (let name of names) {
     if (i++ > MAX_PROPERTIES) {
       break;
     }
     let desc = propertyDescriptor(name, aObject);
     if (desc) {
       ownProperties[name] = desc;