1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-02-02 15:09:23 -05:00

ECMAScript: Fix crash on setTimeout(..., 0)

This commit is contained in:
Petr Baudis 2006-11-21 08:01:36 +01:00 committed by Petr Baudis
parent 92c5be8e95
commit e66b6737db

@ -411,6 +411,8 @@ window_setTimeout(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval
if (!code)
return JS_TRUE;
timeout = atoi(jsval_to_string(ctx, &argv[1]));
if (timeout <= 0)
return JS_TRUE;
ecmascript_set_timeout(interpreter, code, timeout);
return JS_TRUE;
}