Bug 698565 (1/6) - stop excluding keys when calling JSON.stringify() [r=dietrich]

Stop excluding keys.
This commit is contained in:
Paul O’Shannessy 2011-11-08 15:23:42 -08:00
Родитель adc68fc9f4
Коммит 5ca5474f71
1 изменённых файлов: 1 добавлений и 17 удалений

Просмотреть файл

@ -117,11 +117,6 @@ const CAPABILITIES = [
"DNSPrefetch", "Auth", "WindowControl"
];
// These keys are for internal use only - they shouldn't be part of the JSON
// that gets saved to disk nor part of the strings returned by the API.
const INTERNAL_KEYS = ["_tabStillLoading", "_hosts", "_formDataSaved",
"_shouldRestore", "_host", "_scheme"];
// These are tab events that we listen to.
const TAB_EVENTS = ["TabOpen", "TabClose", "TabSelect", "TabShow", "TabHide",
"TabPinned", "TabUnpinned"];
@ -4084,18 +4079,7 @@ SessionStoreService.prototype = {
* @returns the object's JSON representation
*/
_toJSONString: function sss_toJSONString(aJSObject) {
// We never want to save __lastSessionWindowID across sessions, but we do
// want it exported to consumers when running (eg. Private Browsing).
let internalKeys = INTERNAL_KEYS;
if (this._loadState == STATE_QUITTING) {
internalKeys = internalKeys.slice();
internalKeys.push("__lastSessionWindowID");
}
function exclude(key, value) {
// returning undefined results in the exclusion of that key
return internalKeys.indexOf(key) == -1 ? value : undefined;
}
return JSON.stringify(aJSObject, exclude);
return JSON.stringify(aJSObject);
},
_sendRestoreCompletedNotifications: function sss_sendRestoreCompletedNotifications() {