mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-03 04:55:46 +01:00
Fix sanitizer initialization. Add tests.
This commit is contained in:
@@ -1012,7 +1012,7 @@ var Timer = Class("Timer", {
|
||||
|
||||
notify: function (timer, force) {
|
||||
try {
|
||||
if (util.rehashing || typeof util === "undefined" || !force && this.doneAt == 0)
|
||||
if (loaded.util && util.rehashing || typeof util === "undefined" || !force && this.doneAt == 0)
|
||||
return;
|
||||
|
||||
this._timer.cancel();
|
||||
|
||||
@@ -36,6 +36,8 @@ var JavaScript = Module("javascript", {
|
||||
},
|
||||
}),
|
||||
|
||||
lazyInit: true,
|
||||
|
||||
newContext: function () this.modules.newContext(this.modules.userContext),
|
||||
|
||||
get completers() JavaScript.completers, // For backward compatibility
|
||||
|
||||
@@ -290,18 +290,18 @@ var Overlay = Module("Overlay", {
|
||||
});
|
||||
});
|
||||
|
||||
function frob(name) {
|
||||
// util.dump(" ======================== FROB " + name + " ======================== ");
|
||||
(deferredInit[name] || []).forEach(call);
|
||||
}
|
||||
function frob(name) { (deferredInit[name] || []).forEach(call); }
|
||||
|
||||
frob("init");
|
||||
defineModule.modules.forEach(function ({ constructor: { className } }) {
|
||||
modules.__defineGetter__(className, function () {
|
||||
delete modules[className];
|
||||
defineModule.modules.forEach(function ({ lazyInit, constructor: { className } }) {
|
||||
if (!lazyInit)
|
||||
frob(className);
|
||||
return modules[className] = modules[className];
|
||||
});
|
||||
else
|
||||
modules.__defineGetter__(className, function () {
|
||||
delete modules[className];
|
||||
frob(className);
|
||||
return modules[className] = modules[className];
|
||||
});
|
||||
});
|
||||
|
||||
// Module.list.forEach(load);
|
||||
|
||||
@@ -483,7 +483,24 @@ var tests = {
|
||||
sanitize: {
|
||||
// Skip details for now.
|
||||
completions: [
|
||||
"",
|
||||
["", function (context) ["all",
|
||||
"cache",
|
||||
"downloads",
|
||||
"formdata",
|
||||
"offlineapps",
|
||||
"passwords",
|
||||
"sessions",
|
||||
"cookies",
|
||||
"history",
|
||||
"host",
|
||||
"sitesettings",
|
||||
"commandline",
|
||||
"messages",
|
||||
"macros",
|
||||
"marks",
|
||||
"options"
|
||||
].every(function (item) context.allItems.items.some(function ({ text }) item == text))
|
||||
],
|
||||
"-",
|
||||
"-host=",
|
||||
"-timespan="
|
||||
|
||||
Reference in New Issue
Block a user