#2 ✓resolved
Wes Biggs

setTimeout and setInterval string support

Reported by Wes Biggs | January 2nd, 2009 @ 02:53 PM

window.setTimeout and window.setInterval need to support strings as well as functions.

The following patch line can be put as the first line of both functions.

    if (typeof fn == 'string') {
            var fnstr = fn; 
            fn = function() { 
                eval(fnstr); 
            }; 
        }

However, we may want to consider if this should work for String objects (as opposed to primitives), or generally perform a toString on anything that's not a 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 ยป

a javascript browser environment

People watching this ticket

Pages