From e75cd0acddbf56247c01ecd28aefe2b6d7a4ad76 Mon Sep 17 00:00:00 2001 From: Sam Stephenson Date: Thu, 9 Aug 2007 00:27:51 +0000 Subject: [PATCH] prototype: Fix Function#argumentNames for IE --- CHANGELOG | 2 +- src/base.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 171e4fa..dd42f09 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,6 @@ *SVN* -* Fix Function#argumentNames for Opera [Thomas Fuchs] +* Fix Function#argumentNames for Opera and IE. [Thomas Fuchs] * Add Object.isString, Object.isNumber, and Object.isUndefined, and clean up the source to make use of Object.isXXX where possible. [sam] diff --git a/src/base.js b/src/base.js index 853c23d..b2fb118 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(/^\s*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; },