diff --git a/common/content/events.js b/common/content/events.js index bebd5808..71fef679 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -79,9 +79,11 @@ var ProcessorStack = Class("ProcessorStack", { Events.kill(this.events[this.events.length - 1]); if (result === Events.PASS || result === Events.ABORT) { - dbg("REFEED: " + this.events.filter(function (e) e.getPreventDefault()).map(events.closure.toString).join("")); - this.events.filter(function (e) e.getPreventDefault()) - .forEach(function (event, i) { + let list = this.events.filter(function (e) e.getPreventDefault()); + if (list.length) + events.dbg("REFEED: " + list.map(events.closure.toString).join("")); + + list.forEach(function (event, i) { let elem = event.originalTarget; if (event.originalTarget) { let doc = elem.ownerDocument || elem.document || elem; @@ -307,6 +309,8 @@ var EventHive = Class("EventHive", Group.Hive, { * @instance events */ var Events = Module("events", { + dbg: function () {}, + init: function () { const self = this; diff --git a/common/modules/base.jsm b/common/modules/base.jsm index 1b1293bc..12f3c9be 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -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(); diff --git a/common/modules/javascript.jsm b/common/modules/javascript.jsm index d66f0323..e65f3a64 100644 --- a/common/modules/javascript.jsm +++ b/common/modules/javascript.jsm @@ -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 diff --git a/common/modules/overlay.jsm b/common/modules/overlay.jsm index 1106ad2c..957e7773 100644 --- a/common/modules/overlay.jsm +++ b/common/modules/overlay.jsm @@ -291,18 +291,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); diff --git a/common/tests/functional/testCommands.js b/common/tests/functional/testCommands.js index 62eefa5c..60fc7b8f 100644 --- a/common/tests/functional/testCommands.js +++ b/common/tests/functional/testCommands.js @@ -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="