mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1234600 - executeSoon async stacks only when DEBUG_JS_MODULES enabled. r=fitzgen
This commit is contained in:
parent
b4b5b08e9b
commit
53ef3ebcef
@ -189,10 +189,17 @@ exports.executeSoon = function executeSoon(aFn) {
|
||||
if (isWorker) {
|
||||
setImmediate(aFn);
|
||||
} else {
|
||||
let stack = components.stack;
|
||||
let executor = () => {
|
||||
Cu.callFunctionWithAsyncStack(aFn, stack, "DevToolsUtils.executeSoon");
|
||||
};
|
||||
let executor;
|
||||
// Only enable async stack reporting when DEBUG_JS_MODULES is set
|
||||
// (customized local builds) to avoid a performance penalty.
|
||||
if (AppConstants.DEBUG_JS_MODULES || exports.testing) {
|
||||
let stack = components.stack;
|
||||
executor = () => {
|
||||
Cu.callFunctionWithAsyncStack(aFn, stack, "DevToolsUtils.executeSoon");
|
||||
};
|
||||
} else {
|
||||
executor = aFn;
|
||||
}
|
||||
Services.tm.mainThread.dispatch({
|
||||
run: exports.makeInfallible(executor)
|
||||
}, Ci.nsIThread.DISPATCH_NORMAL);
|
||||
|
@ -7,6 +7,11 @@ var Cr = Components.results;
|
||||
var {require} = Cu.import("resource://devtools/shared/Loader.jsm");
|
||||
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
|
||||
|
||||
DevToolsUtils.testing = true;
|
||||
do_register_cleanup(() => {
|
||||
DevToolsUtils.testing = false;
|
||||
});
|
||||
|
||||
// Register a console listener, so console messages don't just disappear
|
||||
// into the ether.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user