Bug 919349: Remove infelicitous uses of 'delete' from the JavaScript debugger server. r=dcamp
authorJim Blandy <jimb@mozilla.com>
Sun, 27 Oct 2013 11:03:20 -0700
changeset 166222 93f1537b3a9daa71ae4d8bad20af076e6148d23e
parent 166221 0ea543f598ed3a8c0611fff8d4dfeaa0c85ddbba
child 166223 7d8d70f3a7c239548b8dbc2d5ba920e5586b0f07
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdcamp
bugs919349
milestone27.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 919349: Remove infelicitous uses of 'delete' from the JavaScript debugger server. r=dcamp
toolkit/devtools/client/dbg-client.jsm
toolkit/devtools/server/main.js
toolkit/devtools/server/transport.js
--- a/toolkit/devtools/client/dbg-client.jsm
+++ b/toolkit/devtools/client/dbg-client.jsm
@@ -966,17 +966,17 @@ TabClient.prototype = {
    * @param function aOnResponse
    *        Called with the response packet.
    */
   detach: DebuggerClient.requester({
     type: "detach"
   }, {
     after: function (aResponse) {
       if (this.activeTab === this._client._tabClients[this.actor]) {
-        delete this.activeTab;
+        this.activeTab = undefined;
       }
       delete this._client._tabClients[this.actor];
       return aResponse;
     },
     telemetry: "TABDETACH"
   }),
 
   /**
@@ -1118,19 +1118,16 @@ ThreadClient.prototype = {
   }, {
     before: function (aPacket) {
       this._assertPaused("resume");
 
       // Put the client in a tentative "resuming" state so we can prevent
       // further requests that should only be sent in the paused state.
       this._state = "resuming";
 
-      if (!aPacket.resumeLimit) {
-        delete aPacket.resumeLimit;
-      }
       if (this._pauseOnExceptions) {
         aPacket.pauseOnExceptions = this._pauseOnExceptions;
       }
       if (this._ignoreCaughtExceptions) {
         aPacket.ignoreCaughtExceptions = this._ignoreCaughtExceptions;
       }
       if (this._pauseOnDOMEvents) {
         aPacket.pauseOnDOMEvents = this._pauseOnDOMEvents;
@@ -1297,17 +1294,17 @@ ThreadClient.prototype = {
    * @param function aOnResponse
    *        Called with the response packet.
    */
   detach: DebuggerClient.requester({
     type: "detach"
   }, {
     after: function (aResponse) {
       if (this.activeThread === this._client._threadClients[this.actor]) {
-        delete this.activeThread;
+        this.activeThread = null;
       }
       delete this._client._threadClients[this.actor];
       return aResponse;
     },
     telemetry: "THREADDETACH"
   }),
 
   /**
--- a/toolkit/devtools/server/main.js
+++ b/toolkit/devtools/server/main.js
@@ -287,17 +287,17 @@ var DebuggerServer = {
       let mod = gRegisteredModules[id];
       mod.module.unregister(mod.api);
     }
     gRegisteredModules = {};
 
     this.closeListener();
     this.globalActorFactories = {};
     this.tabActorFactories = {};
-    delete this._allowConnection;
+    this._allowConnection = null;
     this._transportInitialized = false;
     this._initialized = false;
 
     this._fireConnectionChange("closed");
 
     dumpn("Debugger server is shut down.");
   },
 
@@ -1018,17 +1018,17 @@ DebuggerServerConnection.prototype = {
       try {
         this.currentPacket = aPacket;
         ret = actor.requestTypes[aPacket.type].bind(actor)(aPacket, this);
       } catch(e) {
         this.transport.send(this._unknownError(
           "error occurred while processing '" + aPacket.type,
           e));
       } finally {
-        delete this.currentPacket;
+        this.currentPacket = undefined;
       }
     } else {
       ret = { error: "unrecognizedPacketType",
               message: ('Actor "' + actor.actorID +
                         '" does not recognize the packet type "' +
                         aPacket.type + '"') };
     }
 
--- a/toolkit/devtools/server/transport.js
+++ b/toolkit/devtools/server/transport.js
@@ -264,17 +264,17 @@ LocalDebuggerTransport.prototype = {
   /**
    * Close the transport.
    */
   close: function LDT_close() {
     if (this.other) {
       // Remove the reference to the other endpoint before calling close(), to
       // avoid infinite recursion.
       let other = this.other;
-      delete this.other;
+      this.other = null;
       other.close();
     }
     if (this.hooks) {
       try {
         this.hooks.onClosed();
       } catch(ex) {
         Components.utils.reportError(ex);
       }