From 4f7214873c340bfb6e3f437580e8615b9f20d26f Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sun, 16 Feb 2014 20:43:15 -0800 Subject: [PATCH] Remove more cruft. --- common/modules/base.jsm | 11 ++--------- common/modules/template.jsm | 20 +------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/common/modules/base.jsm b/common/modules/base.jsm index 22c14a11..a4550d29 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -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 diff --git a/common/modules/template.jsm b/common/modules/template.jsm index 4aa2c888..39ce2f97 100644 --- a/common/modules/template.jsm +++ b/common/modules/template.jsm @@ -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) {