[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r14358: Do same for sessionstartup hooks. (torbutton/trunk/src/components)



Author: mikeperry
Date: 2008-04-11 03:57:17 -0400 (Fri, 11 Apr 2008)
New Revision: 14358

Modified:
   torbutton/trunk/src/components/crash-observer.js
Log:

Do same for sessionstartup hooks.



Modified: torbutton/trunk/src/components/crash-observer.js
===================================================================
--- torbutton/trunk/src/components/crash-observer.js	2008-04-11 07:56:20 UTC (rev 14357)
+++ torbutton/trunk/src/components/crash-observer.js	2008-04-11 07:57:17 UTC (rev 14358)
@@ -48,6 +48,8 @@
     }
     return store;
   };
+
+  this.copyMethods(this._store());
 }
 
 StoreWrapper.prototype =
@@ -86,9 +88,10 @@
           var params = [];
           params.length = wrapped[method].length;
           var x = 0;
-          var call = method + "("+params.join().replace(/(?:)/g,function(){return "p"+(++x)})+")";
+          if(params.length) call = "("+params.join().replace(/(?:)/g,function(){return "p"+(++x)})+")";
+          else call = "()";
           var fun = "function "+call+"{if (arguments.length < "+wrapped[method].length+") throw Components.results.NS_ERROR_XPC_NOT_ENOUGH_ARGS; return wrapped."+method+".apply(wrapped, arguments);}";
-          // Already in scope
+          // already in scope
           //var Components = this.Components;
           newObj[method] = eval(fun);
       } else {