1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 22:44:12 +01:00

Finish moving dactyl.dump to util from last commit, and store the last 15 intercepted stack traces.

This commit is contained in:
Kris Maglione
2010-10-06 18:08:07 -04:00
parent 312244c00c
commit 8c98658e74
12 changed files with 34 additions and 36 deletions

View File

@@ -1964,7 +1964,7 @@ const ItemList = Class("ItemList", {
//if (index == 0)
// this.start = now;
//if (index == Math.min(len - 1, 100))
// dactyl.dump({ time: Date.now() - this.start });
// util.dump({ time: Date.now() - this.start });
},
onEvent: function onEvent(event) false

View File

@@ -59,7 +59,7 @@ const Dactyl = Module("dactyl", {
autocommands.trigger("LeavePre", {});
storage.saveAll();
dactyl.triggerObserver("shutdown", null);
dactyl.dump("All dactyl modules destroyed\n");
util.dump("All dactyl modules destroyed\n");
autocommands.trigger("Leave", {});
},
@@ -1897,7 +1897,7 @@ const Dactyl = Module("dactyl", {
dactyl.commandLineOptions.noPlugins = "++noplugin" in args;
dactyl.commandLineOptions.postCommands = args["+c"];
dactyl.commandLineOptions.preCommands = args["++cmd"];
dactyl.dump("Processing command-line option: " + commandline);
util.dump("Processing command-line option: " + commandline);
}
dactyl.log("Command-line options: " + util.objectToString(dactyl.commandLineOptions), 3);

View File

@@ -88,7 +88,7 @@ const Events = Module("events", {
},
destroy: function () {
dactyl.dump("Removing all event listeners");
util.dump("Removing all event listeners");
for (let args in values(this.sessionListeners))
args[0].removeEventListener.apply(args[0], args.slice(1));
},
@@ -571,7 +571,7 @@ const Events = Module("events", {
* @returns {boolean}
*/
waitForPageLoad: function () {
//dactyl.dump("start waiting in loaded state: " + buffer.loaded);
//util.dump("start waiting in loaded state: " + buffer.loaded);
util.threadYield(true); // clear queue
if (buffer.loaded == 1)
@@ -584,7 +584,7 @@ const Events = Module("events", {
while (now = Date.now(), now < end) {
util.threadYield();
//if ((now - start) % 1000 < 10)
// dactyl.dump("waited: " + (now - start) + " ms");
// util.dump("waited: " + (now - start) + " ms");
if (!events.feedingKeys)
return false;
@@ -602,7 +602,7 @@ const Events = Module("events", {
let ret = (buffer.loaded == 1);
if (!ret)
dactyl.echoerr("Page did not load completely in " + maxWaitTime + " seconds. Macro stopped.");
//dactyl.dump("done waiting: " + ret);
//util.dump("done waiting: " + ret);
// sometimes the input widget had focus when replaying a macro
// maybe this call should be moved somewhere else?

View File

@@ -62,6 +62,8 @@ const JavaScript = Module("javascript", {
return [];
let completions = [k for (k in this.iter(obj, toplevel))];
if (obj == modules) // Hack.
completions = completions.concat([k for (k in this.iter(jsmodules, toplevel))]);
return completions;
},

View File

@@ -82,7 +82,6 @@ window.addEventListener("load", function onLoad() {
});
});
function dump(str) window.dump(String.replace(str, /\n?$/, "\n").replace(/^/m, services.get("dactyl:").name + ": "));
const start = Date.now();
const deferredInit = { load: [] };
const seen = set();
@@ -136,7 +135,7 @@ window.addEventListener("load", function onLoad() {
fn();
}
catch (e) {
dump("Loading " + (module && module.className) + ": " + e + "\n" + (e.stack || ""));
util.dump("Loading " + (module && module.className) + ": " + e + "\n" + (e.stack || ""));
}
return modules[module.className];
}
@@ -145,7 +144,7 @@ window.addEventListener("load", function onLoad() {
deferredInit["load"].forEach(call);
modules.times = update({}, defineModule.times);
dump("Loaded in " + (Date.now() - start) + "ms");
util.dump("Loaded in " + (Date.now() - start) + "ms");
}, false);
window.addEventListener("unload", function onUnload() {

View File

@@ -157,7 +157,6 @@ const QuickMarks = Module("quickmarks", {
commands.add(["qmarks"],
"Show all QuickMarks",
function (args) {
dactyl.dump(args);
args = args[0] || "";
// ignore invalid qmark characters unless there are no valid qmark chars