#63 ✓resolved
Geoff M. Granum

Function.arguments uses regexp that breaks with IE

Reported by Geoff M. Granum | April 29th, 2008 @ 11:35 PM | in

IE7 fails to parse through new lines when the non-greedy flag is used with .*. Thus if your JS function has a line break in the arguments list, Function.arguments will blow up due to the lack of match.

Attempt to match this function string with the regex at line 201 of prototype 1.6.0_02:

function( id, arg1, arg2,

arg3AfterLineBreak, arg4 )


// code


The regex is currently: /^[\s\(]*function[^(]*\((.*?)\)/

The regex that will work with IE is: /^[\s\(]*function[^(]*\(([^)]*)\)/

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket