From c79c595ee7e200bd6d1a73a6e0b597eae338d6f1 Mon Sep 17 00:00:00 2001 From: reality Date: Tue, 12 Feb 2013 18:34:36 +0000 Subject: [PATCH] Remove object prototype extensions in master [#135] --- modules/quotes/commands.js | 2 +- run.js | 2 +- snippets.js | 64 -------------------------------------- 3 files changed, 2 insertions(+), 66 deletions(-) diff --git a/modules/quotes/commands.js b/modules/quotes/commands.js index 86cf45b..6cda060 100644 --- a/modules/quotes/commands.js +++ b/modules/quotes/commands.js @@ -86,7 +86,7 @@ var commands = function(dbot) { event.reply(dbot.t('search_results', { 'category': haystack, 'needle': needle, - 'quote': matches.random(), + 'quote': matches[0], 'matches': matches.length })); } diff --git a/run.js b/run.js index 97667cb..48ad4d5 100644 --- a/run.js +++ b/run.js @@ -113,7 +113,7 @@ DBot.prototype.save = function() { // Hot-reload module files. DBot.prototype.reloadModules = function() { if(this.modules) { // Run 'onDestroy' code for each module if it exists. - this.modules.each(function(module) { + _.each(this.modules, function(module) { if(module.onDestroy) { module.onDestroy(); } diff --git a/snippets.js b/snippets.js index f8fcfe4..b552bf3 100644 --- a/snippets.js +++ b/snippets.js @@ -1,9 +1,5 @@ /*** Array ***/ -Array.prototype.random = function() { - return this[Math.floor((Math.random()*this.length))]; -}; - Array.prototype.each = function(fun) { for(var i=0;i