1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-09 06:14:11 +01:00

Remove more cruft.

This commit is contained in:
Kris Maglione
2014-02-16 20:43:15 -08:00
parent 08e00164b2
commit 4f7214873c
2 changed files with 3 additions and 28 deletions

View File

@@ -263,30 +263,12 @@ var Template = Module("Template", {
})(), this[help ? "HelpLink" : "helpLink"]);
},
// Fixes some strange stack rewinds on NS_ERROR_OUT_OF_MEMORY
// exceptions that we can't catch.
stringify: function stringify(arg) {
if (!callable(arg))
return String(arg);
try {
this._sandbox.arg = arg;
return Cu.evalInSandbox("String(arg)", this._sandbox);
}
finally {
this._sandbox.arg = null;
}
},
_sandbox: Class.Memoize(() => Cu.Sandbox(Cu.getGlobalForObject(global),
{ wantXrays: false })),
// if "processStrings" is true, any passed strings will be surrounded by " and
// any line breaks are displayed as \n
highlight: function highlight(arg, processStrings, clip, bw) {
// some objects like window.JSON or getBrowsers()._browsers need the try/catch
try {
let str = this.stringify(arg);
let str = String(arg);
if (clip)
str = util.clip(str, clip);
switch (arg == null ? "undefined" : typeof arg) {