mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1215203 - Log a deprecation warning when DevToolsUtils.dbg_assert is called. r=jlongster
This commit is contained in:
parent
e8e1387f15
commit
dbcefad986
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user