Bug 797529 - Make DevToolsUtils.js compatible with B2G compartment sharing, r=past
authorJonathan Griffin <jgriffin@mozilla.com>
Thu, 06 Jun 2013 20:00:11 -0700
changeset 134529 613d6ed5ccdb86bf9d965c2bc8d4f24a708804a1
parent 134528 5e011badb20ef6b64af43577493414d28cc0a5e7
child 134530 70b692093c94282638f722acd016ff0039207d32
push id29253
push userjgriffin@mozilla.com
push dateMon, 10 Jun 2013 17:24:51 +0000
treeherdermozilla-inbound@48d63831553f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs797529
milestone24.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 797529 - Make DevToolsUtils.js compatible with B2G compartment sharing, r=past
toolkit/devtools/DevToolsUtils.js
--- a/toolkit/devtools/DevToolsUtils.js
+++ b/toolkit/devtools/DevToolsUtils.js
@@ -2,30 +2,30 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 /* General utilities used throughout devtools. */
 
 /* Turn the error e into a string, without fail. */
-function safeErrorString(aError) {
+this.safeErrorString = function safeErrorString(aError) {
   try {
     var s = aError.toString();
     if (typeof s === "string")
       return s;
   } catch (ee) { }
 
   return "<failed trying to find error description>";
 }
 
 /**
  * Report that |aWho| threw an exception, |aException|.
  */
-function reportException(aWho, aException) {
+this.reportException = function reportException(aWho, aException) {
   let msg = aWho + " threw an exception: " + safeErrorString(aException);
   if (aException.stack) {
     msg += "\nCall stack:\n" + aException.stack;
   }
 
   dump(msg + "\n");
 
   if (Components.utils.reportError) {
@@ -47,17 +47,17 @@ function reportException(aWho, aExceptio
  *      A handler function, which may throw.
  * @param aName string
  *      A name for aHandler, for use in error messages. If omitted, we use
  *      aHandler.name.
  *
  * (SpiderMonkey does generate good names for anonymous functions, but we
  * don't have a way to get at them from JavaScript at the moment.)
  */
-function makeInfallible(aHandler, aName) {
+this.makeInfallible = function makeInfallible(aHandler, aName) {
   if (!aName)
     aName = aHandler.name;
 
   return function (/* arguments */) {
     try {
       return aHandler.apply(this, arguments);
     } catch (ex) {
       let who = "Handler function";