#661 ✓resolved

Regexps break subclass creation in Mac Safari 3.1

Reported by James | April 24th, 2009 @ 03:48 PM | in 1.7

The following object instantiation code fails in Mac Safari 3.1:

var X = Class.create({});
var Y = Class.create(X, {myRegex: /xyz/});

This produces the error "Value undefined (result of expression value.argumentNames) is not object." In Mac Safari 3.1, Object.isFunction(/xyz/) returns true, but /xyz/.toString() returns "/xyz/" so the match in the argumentNames function fails to return anything, causing the error.

I'm using prototype version, but looked at the latest bundle in the Downloads section and it doesn't look like this is fixed there either.

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

Referenced by