diff --git a/devtools/shared/DevToolsUtils.js b/devtools/shared/DevToolsUtils.js index 6453855ce5a..a5b187d206a 100644 --- a/devtools/shared/DevToolsUtils.js +++ b/devtools/shared/DevToolsUtils.js @@ -441,7 +441,18 @@ exports.defineLazyGetter = function defineLazyGetter(aObject, aName, aLambda) { }; // 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; }