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; },