Bug 920801 - Port chat/ changes from Instantbird to comm-central - 6 - Bio 2166 - JS-IRC spends more time than it needs in hasOwnProperty calls, r=clokep.

This commit is contained in:
Florian Quèze 2013-09-13 00:14:02 +02:00
Родитель 05c95f6a3e
Коммит c01070fc46
2 изменённых файлов: 4 добавлений и 8 удалений

Просмотреть файл

@ -6,7 +6,6 @@ const EXPORTED_SYMBOLS = ["ircHandlers"];
const Cu = Components.utils;
Cu.import("resource:///modules/imXPCOMUtils.jsm");
Cu.import("resource:///modules/ircUtils.jsm");
var ircHandlers = {
@ -100,7 +99,7 @@ var ircHandlers = {
// command.
// Parse the command with the JavaScript account object as "this".
if (handler.isEnabled.call(aAccount) &&
hasOwnProperty(handler.commands, aCommand) &&
Object.prototype.hasOwnProperty.call(handler.commands, aCommand) &&
handler.commands[aCommand].call(aAccount, aMessage))
return true;
} catch (e) {
@ -153,4 +152,4 @@ var ircHandlers = {
get LOW_PRIORITY() -100,
get DEFAULT_PRIORITY() 0,
get HIGH_PRIORITY() 100
}
};

Просмотреть файл

@ -128,8 +128,7 @@ var ircWATCH = {
// Slightly above default IRC priority.
priority: ircHandlers.DEFAULT_PRIORITY + 10,
// Use WATCH if it is supported.
isEnabled: function()
this.hasOwnProperty("watchEnabled") && this.watchEnabled,
isEnabled: function() !!this.watchEnabled,
commands: {
"251": function(aMessage) { // RPL_LUSERCLIENT
@ -310,9 +309,7 @@ var ircMONITOR = {
priority: ircHandlers.DEFAULT_PRIORITY + 10,
// Use MONITOR only if MONITOR is enabled and WATCH is not enabled, as WATCH
// supports more features.
isEnabled: function()
this.hasOwnProperty("monitorEnabled") && this.monitorEnabled &&
!(this.hasOwnProperty("watchEnabled") && this.watchEnabled),
isEnabled: function() this.monitorEnabled && !this.watchEnabled,
commands: {
"251": function(aMessage) { // RPL_LUSERCLIENT