prototype: Fix Function#argumentNames for Opera

This commit is contained in:
Sam Stephenson 2007-08-08 23:50:36 +00:00
parent df71a6b54f
commit 220f6379f1
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
*SVN*
* Fix Function#argumentNames for Opera [Thomas Fuchs]
* Add Object.isString, Object.isNumber, and Object.isUndefined, and clean up the source to make use of Object.isXXX where possible. [sam]
* Add the document.viewport object for querying dimensions and scroll offsets of the browser viewport. [Andrew Dupont, Thomas Fuchs, sam]

View File

@ -154,7 +154,7 @@ Object.extend(Object, {
Object.extend(Function.prototype, {
argumentNames: function() {
var names = this.toString().match(/^function\s*\((.*?)\)/)[1].split(",").invoke("strip");
var names = this.toString().match(/^\s*function\s*\((.*?)\)/)[1].split(",").invoke("strip");
return names.length == 1 && !names[0] ? [] : names;
},