+ // 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(function () Cu.Sandbox(global, { wantXrays: false })),
+