From de5cc4a0f9465b3a8b96de4b9e2e98c1b8c562db Mon Sep 17 00:00:00 2001 From: Tobie Langel Date: Mon, 5 May 2008 09:21:46 +0200 Subject: [PATCH] Speed up Function#argumentNames. Avoid Enum dependency. --- CHANGELOG | 2 ++ src/base.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 5a2cccc..03df885 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Speed up Function#argumentNames. Avoid Enum dependency. (samleb, Tobie Langel) + * Fix Event#element accessing inexistent tagName property (e.g. when element is a document). (kangax) * Amended failing Element#identify test. diff --git a/src/base.js b/src/base.js index 2d75f32..6120c41 100644 --- a/src/base.js +++ b/src/base.js @@ -159,7 +159,7 @@ Object.extend(Object, { Object.extend(Function.prototype, { argumentNames: function() { - var names = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip"); + var names = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(/\s*,\s*/); return names.length == 1 && !names[0] ? [] : names; },