Bug 758486 - Settings API: make debug output a bit more useful. r=gwagner

This commit is contained in:
Philipp von Weitershausen 2012-05-25 10:37:45 -07:00
parent 5cdf5a7848
commit f756c14117
2 changed files with 11 additions and 10 deletions

View File

@ -69,9 +69,9 @@ DOMRequestIpcHelper.prototype = {
initMessageListener: function initMessageListener(aMessages) {
this._messages = aMessages;
this._messages.forEach((function(msgName) {
this._messages.forEach(function(msgName) {
cpmm.addMessageListener(msgName, this);
}).bind(this));
}, this);
},
initHelper: function(aWindow, aMessages) {
@ -85,9 +85,9 @@ DOMRequestIpcHelper.prototype = {
},
removeMessageListener: function removeMessageListener() {
this._messages.forEach((function(msgName) {
this._messages.forEach(function(msgName) {
cpmm.removeMessageListener(msgName, this);
}).bind(this));
}, this);
this._messages = null;
},

View File

@ -2,14 +2,14 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"
"use strict";
/* static functions */
let DEBUG = 0;
let DEBUG = false;
if (DEBUG)
debug = function (s) { dump("-*- SettingsManager: " + s + "\n"); }
debug = function (s) { dump("-*- SettingsManager: " + s + "\n"); };
else
debug = function (s) {}
debug = function (s) {};
const Cc = Components.classes;
const Ci = Components.interfaces;
@ -84,7 +84,8 @@ SettingsLock.prototype = {
req = store.getAll(info.name);
}
req.onsuccess = function(event) {
debug("Request successful. Record count:" + event.target.result.length);
debug("Request for '" + info.name + "' successful. " +
"Record count: " + event.target.result.length);
debug("result: " + JSON.stringify(event.target.result));
var result = {};
for (var i in event.target.result)