From 220f6379f19ba710a978db8012b1feeb5cdca3ba Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Wed, 8 Aug 2007 23:50:36 +0000 Subject: [PATCH] prototype: Fix Function#argumentNames for Opera --- CHANGELOG | 2 ++ src/base.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 08dc3d7..171e4fa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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] diff --git a/src/base.js b/src/base.js index 07ac8d9..853c23d 100644 --- a/src/base.js +++ b/src/base.js @@ -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; },