Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

setTimeout and setInterval string support

#2

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.

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

State: resolved
Milestone: none

Activity

  1. thatcher.christopher (at gmail)
    thatcher.christopher (at gmail)
    • Tag set to global, setinterval, settimeout
    • State changed from new to resolved
    • Assigned user set to thatcher.christopher (at gmail)

    January 15th, 2009 @ 12:28 PM

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.