From b628c6de5cece138479d85e0915c55667fdf5991 Mon Sep 17 00:00:00 2001 From: Tobie Langel Date: Wed, 7 May 2008 12:35:43 +0200 Subject: [PATCH] Avoid potential memory leaks in Firefox. [#12 state:resolved] --- CHANGELOG | 2 ++ src/base.js | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1d11283..403ffd3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Avoid potential memory leaks in Firefox. (wpc, Tobie Langel) [#12 state:resolved] + * More unit tests for Object.isHash. (Tobie Langel) * Allow Function#argumentNames to handle line breaks between arguments. (Geoff M. Granum, Tobie Langel) [#63 state:resolved] diff --git a/src/base.js b/src/base.js index 072d204..3074e2e 100644 --- a/src/base.js +++ b/src/base.js @@ -194,6 +194,11 @@ Object.extend(Function.prototype, { }, timeout); }, + defer: function() { + var args = [0.01].concat($A(arguments)); + return this.delay.apply(this, args); + }, + wrap: function(wrapper) { var __method = this; return function() { @@ -210,8 +215,6 @@ Object.extend(Function.prototype, { } }); -Function.prototype.defer = Function.prototype.delay.curry(0.01); - Date.prototype.toJSON = function() { return '"' + this.getUTCFullYear() + '-' + (this.getUTCMonth() + 1).toPaddedString(2) + '-' +