Speed up Function#argumentNames. Avoid Enum dependency.
This commit is contained in:
parent
b75bc189ec
commit
de5cc4a0f9
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue