1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-03 00:05:51 +01:00

Death to E4X and stuff.

This commit is contained in:
Kris Maglione
2012-11-28 18:35:19 -08:00
parent ce51debcdc
commit 9420c58772
3 changed files with 48 additions and 48 deletions

View File

@@ -1024,7 +1024,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
return color ? <div style="white-space: pre-wrap;">{string}</div> : [s for each (s in string)].join("");
},
prettifyJSON: function prettifyJSON(data, indent) {
prettifyJSON: function prettifyJSON(data, indent, invalidOK) {
const INDENT = indent || " ";
function rec(data, level, seen) {
@@ -1072,6 +1072,8 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
else
res[res.length - 1] = "{}";
}
else if (invalidOK)
res.push({}.toString.call(data));
else
throw Error("Invalid JSON object");
}