Bug 1233865 - Remove deprecated dbg_assert. r=fitzgen
authorJ. Ryan Stinnett <jryans@gmail.com>
Fri, 18 Dec 2015 17:02:00 -0600
changeset 316915 79bbc8864c85a98b2743700a121b2a5b8afa7fa3
parent 316914 0df8478ca614b4a02a1dc9e78a6d4ed785fa1506
child 316916 393c1c57065b2055bc0c4f129833332b3689a551
push id8629
push userjlorenzo@mozilla.com
push dateTue, 22 Dec 2015 11:12:02 +0000
reviewersfitzgen
bugs1233865
milestone46.0a1
Bug 1233865 - Remove deprecated dbg_assert. r=fitzgen
devtools/server/actors/script.js
devtools/shared/DevToolsUtils.js
--- a/devtools/server/actors/script.js
+++ b/devtools/server/actors/script.js
@@ -7,17 +7,17 @@
 "use strict";
 
 const Services = require("Services");
 const { Cc, Ci, Cu, components, ChromeWorker } = require("chrome");
 const { ActorPool, OriginalLocation, GeneratedLocation } = require("devtools/server/actors/common");
 const { ObjectActor, createValueGrip, longStringGrip } = require("devtools/server/actors/object");
 const { DebuggerServer } = require("devtools/server/main");
 const DevToolsUtils = require("devtools/shared/DevToolsUtils");
-const { assert, dbg_assert, dumpn, update, fetch } = DevToolsUtils;
+const { assert, dumpn, update, fetch } = DevToolsUtils;
 const { dirname, joinURI } = require("devtools/shared/path");
 const promise = require("promise");
 const PromiseDebugging = require("PromiseDebugging");
 const xpcInspector = require("xpcInspector");
 const ScriptStore = require("./utils/ScriptStore");
 const { DevToolsWorker } = require("devtools/shared/worker/worker");
 
 const { defer, resolve, reject, all } = promise;
@@ -349,18 +349,16 @@ EventLoop.prototype = {
     // Keep exiting nested event loops while the last requestor is resolved.
     if (xpcInspector.eventLoopNestLevel > 0) {
       const { resolved } = xpcInspector.lastNestRequestor;
       if (resolved) {
         xpcInspector.exitNestedEventLoop();
       }
     }
 
-    dbg_assert(this._thread.state === "running", "Should be in the running state");
-
     if (this._hooks.postNest) {
       this._hooks.postNest(nestData);
     }
   },
 
   /**
    * Resolve this nested event loop.
    *
--- a/devtools/shared/DevToolsUtils.js
+++ b/devtools/shared/DevToolsUtils.js
@@ -456,34 +456,16 @@ exports.defineLazyGetter = function defi
       delete aObject[aName];
       return aObject[aName] = aLambda.apply(aObject);
     },
     configurable: true,
     enumerable: true
   });
 };
 
-// DEPRECATED: use DevToolsUtils.assert(condition, message) instead!
-let haveLoggedDeprecationMessage = false;
-exports.dbg_assert = function dbg_assert(cond, e) {
-  if (!haveLoggedDeprecationMessage) {
-    haveLoggedDeprecationMessage = true;
-    const deprecationMessage = "DevToolsUtils.dbg_assert is deprecated! Use DevToolsUtils.assert instead!\n"
-          + Error().stack;
-    dump(deprecationMessage);
-    if (typeof console === "object" && console && console.warn) {
-      console.warn(deprecationMessage);
-    }
-  }
-
-  if (!cond) {
-    return e;
-  }
-};
-
 exports.defineLazyGetter(this, "AppConstants", () => {
   if (isWorker) {
     return {};
   }
   const scope = {};
   Cu.import("resource://gre/modules/AppConstants.jsm", scope);
   return scope.AppConstants;
 });