From 29b81fda6940a0966339798ff650b1c534c5f1c8 Mon Sep 17 00:00:00 2001 From: tjcrowder Date: Thu, 10 Sep 2009 10:31:56 +0100 Subject: [PATCH] doc: Merged old docs for Function#argumentNames. --- src/lang/function.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lang/function.js b/src/lang/function.js index f535766..9aec762 100644 --- a/src/lang/function.js +++ b/src/lang/function.js @@ -23,6 +23,17 @@ Object.extend(Function.prototype, (function() { * Reads the argument names as stated in the function definition and returns * the values as an array of strings (or an empty array if the function is * defined without parameters). + * + * ### Examples + * + * function fn(foo, bar) { + * return foo + bar; + * } + * fn.argumentNames(); + * //-> ['foo', 'bar'] + * + * Prototype.emptyFunction.argumentNames(); + * //-> [] **/ function argumentNames() { var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1]