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
-
thatcher.christopher (at gmail) January 15th, 2009 @ 12:28 PM
- Tag set to global, setinterval, settimeout
- State changed from new to resolved
- Assigned user set to thatcher.christopher (at gmail)
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.
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