From 889b1142f2577195bcfbd94ed81ee1ed6a70d781 Mon Sep 17 00:00:00 2001 From: "silver%warwickcompsoc.co.uk" Date: Fri, 14 Jul 2006 12:02:17 +0000 Subject: [PATCH] Bug 343902 - Replace usage of Date.now() with 1.0-compatible code. Long live Mozilla 1.0! ChatZilla only. p=rdmsoft@bugs.rdmsoft.com (Robert Marshall) r=silver --- extensions/irc/xul/content/handlers.js | 4 ++-- extensions/irc/xul/content/static.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/irc/xul/content/handlers.js b/extensions/irc/xul/content/handlers.js index 4646e29a2521..4891dfdb2785 100644 --- a/extensions/irc/xul/content/handlers.js +++ b/extensions/irc/xul/content/handlers.js @@ -685,7 +685,7 @@ function onWhoTimeout() net.primServ.LIGHTWEIGHT_WHO = true; net.primServ.sendData("WHO " + chan.encodedName + "\n"); net.lastWhoCheckChannel = chan; - net.lastWhoCheckTime = Date.now(); + net.lastWhoCheckTime = Number(new Date()); return; } @@ -705,7 +705,7 @@ function onWhoTimeout() var period = net.prefs["autoAwayPeriod"]; // The time since the last check, with a 5s error margin to // stop us from not checking because the timer fired a tad early: - var waited = Date.now() - net.lastWhoCheckTime + 5000; + var waited = Number(new Date()) - net.lastWhoCheckTime + 5000; if (net.isConnected() && (period != 0) && (period * 60000 < waited)) checkWho(); } diff --git a/extensions/irc/xul/content/static.js b/extensions/irc/xul/content/static.js index be63f7dadd82..28b6d8cf2161 100644 --- a/extensions/irc/xul/content/static.js +++ b/extensions/irc/xul/content/static.js @@ -184,7 +184,7 @@ function init() client.openLogFile(client); // kick-start a log-check interval to make sure we change logfiles in time: // It will fire 2 seconds past the next full hour. - setTimeout("checkLogFiles()", 3602000 - (Date.now() % 3600000)); + setTimeout("checkLogFiles()", 3602000 - (Number(new Date()) % 3600000)); // Make sure the userlist is on the correct side. updateUserlistSide(client.prefs["userlistLeft"]); @@ -4628,7 +4628,7 @@ function checkLogFiles() // We use the same line again to make sure we keep a constant offset // from the full hour, in case the timers go crazy at some point. - setTimeout("checkLogFiles()", 3602000 - (Date.now() % 3600000)); + setTimeout("checkLogFiles()", 3602000 - (Number(new Date()) % 3600000)); } CIRCChannel.prototype.getLCFunction =