basilisk -jsdebugger - Import Console.jsm before calling console.[something]

https://github.com/MoonchildProductions/moebius/pull/250
This commit is contained in:
janekptacijarabaci 2018-02-28 15:12:38 +01:00 • committed by Roy Tam
commit 8d210f18c8

View file

@ -104,12 +104,14 @@ DevToolsStartup.prototype = {
return Services.prefs.getBoolPref(pref); return Services.prefs.getBoolPref(pref);
}); });
} catch (ex) { } catch (ex) {
let { console } = Cu.import("resource://gre/modules/Console.jsm", {});
console.error(ex); console.error(ex);
return false; return false;
} }
if (!remoteDebuggingEnabled) { if (!remoteDebuggingEnabled) {
let errorMsg = "Could not run chrome debugger! You need the following " + let errorMsg = "Could not run chrome debugger! You need the following " +
"prefs to be set to true: " + kDebuggerPrefs.join(", "); "prefs to be set to true: " + kDebuggerPrefs.join(", ");
let { console } = Cu.import("resource://gre/modules/Console.jsm", {});
console.error(new Error(errorMsg)); console.error(new Error(errorMsg));
// Dump as well, as we're doing this from a commandline, make sure people // Dump as well, as we're doing this from a commandline, make sure people
// don't miss it: // don't miss it: