Fix issue where Function#argumentNames returned incorrect results in IE when comments were intermixed with argument names. [#397 state:resolved]
This commit is contained in:
parent
0cc28be265
commit
62a1f7e2ce
|
@ -1,3 +1,5 @@
|
|||
* Fix issue where Function#argumentNames returned incorrect results in IE when comments were intermixed with argument names. (Christophe Porteneuve, T.J. Crowder)
|
||||
|
||||
* Performance improvements in Function methods (Samuel Lebeau, kangax, jddalton, Tobie Langel).
|
||||
|
||||
*1.6.0.3* (September 29, 2008)
|
||||
|
|
|
@ -13,7 +13,8 @@ Object.extend(Function.prototype, (function() {
|
|||
}
|
||||
|
||||
function argumentNames() {
|
||||
var names = this.toString().match(/^[\s\(]*function[^(]*\(([^\)]*)\)/)[1]
|
||||
var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1]
|
||||
.replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '')
|
||||
.replace(/\s+/g, '').split(',');
|
||||
return names.length == 1 && !names[0] ? [] : names;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue