mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-29 01:22:28 +01:00
Remove more cruft.
This commit is contained in:
@@ -547,16 +547,9 @@ function curry(fn, length, self, acc) {
|
||||
return curried;
|
||||
}
|
||||
|
||||
if (curry.bind)
|
||||
var bind = function bind(meth, self, ...args) let (func = callable(meth) ? meth : self[meth])
|
||||
var bind = function bind(meth, self, ...args)
|
||||
let (func = callable(meth) ? meth : self[meth])
|
||||
func.bind.apply(func, [self].concat(args));
|
||||
else
|
||||
var bind = function bind(func, self, ...args) {
|
||||
if (!callable(func))
|
||||
func = self[func];
|
||||
|
||||
return function bound(...args2) func.apply(self, args.concat(args2));
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if both arguments are functions and
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user