Bug 1015794 - use Object.create to create services timer objects. r=rnewman
authorMark Hammond <mhammond@skippinet.com.au>
Thu, 12 Jun 2014 10:06:47 +1000
changeset 188326 db5e9bc213dbb528fdfec6faae5a9a806e9c4ba1
parent 188325 8da1a657058f561c4b5d1ed9060936951eb3ccc5
child 188327 c1c53022dae4402449762eb4b8046441ffc77102
push id26951
push useremorley@mozilla.com
push dateThu, 12 Jun 2014 14:07:43 +0000
treeherdermozilla-central@4f98802de6ce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrnewman
bugs1015794
milestone33.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 1015794 - use Object.create to create services timer objects. r=rnewman
services/common/utils.js
--- a/services/common/utils.js
+++ b/services/common/utils.js
@@ -161,19 +161,17 @@ this.CommonUtils = {
 
     // Delay an existing timer if it exists
     if (name in thisObj && thisObj[name] instanceof Ci.nsITimer) {
       thisObj[name].delay = wait;
       return;
     }
 
     // Create a special timer that we can add extra properties
-    let timer = {
-      __proto__: Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer),
-    };
+    let timer = Object.create(Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer));
 
     // Provide an easy way to clear out the timer
     timer.clear = function() {
       thisObj[name] = null;
       timer.cancel();
     };
 
     // Initialize the timer with a smart callback