[Pkg-mozext-commits] [tabmixplus] 03/47: Use Object.create instead of __proto__
David Prévot
taffit at moszumanska.debian.org
Fri Sep 26 20:56:59 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch upstream
in repository tabmixplus.
commit c29ad9d676efddfc672fe25d5f532880f3207b18
Author: onemen <tabmix.onemen at gmail.com>
Date: Wed Sep 17 13:44:14 2014 +0300
Use Object.create instead of __proto__
---
modules/log.jsm | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/modules/log.jsm b/modules/log.jsm
index df0211b..05b8473 100644
--- a/modules/log.jsm
+++ b/modules/log.jsm
@@ -55,10 +55,8 @@ let console = {
}.bind(this);
if (aDelay >= 0) {
- let timer = {};
- timer.__proto__ = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
let timerID = gNextID++;
- this._timers[timerID] = timer;
+ let timer = Object.create(Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer));
timer.clear = function() {
if (timerID in this._timers)
delete this._timers[timerID];
@@ -69,10 +67,14 @@ let console = {
timer.clear();
}, false);
}
- timer.initWithCallback(function() {
- timer.clear();
- logMethod();
+ timer.initWithCallback({
+ notify: function notify() {
+ timer.clear();
+ logMethod();
+ }
}, aDelay, Ci.nsITimer.TYPE_ONE_SHOT);
+
+ this._timers[timerID] = timer;
}
else
logMethod();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/tabmixplus.git
More information about the Pkg-mozext-commits
mailing list