1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-28 03:06:20 -04:00

[spidermonkey] allow timeout == 0 for setTimeout

This commit is contained in:
Witold Filipczyk 2024-06-09 18:42:03 +02:00
parent 761752239f
commit 17eaef0688

View File

@ -639,12 +639,17 @@ window_setTimeout(JSContext *ctx, unsigned int argc, JS::Value *rval)
char *code;
int timeout;
if (argc != 2)
if (argc < 1) {
return true;
}
timeout = args[1].toInt32();
if (argc > 1) {
timeout = args[1].toInt32();
} else {
timeout = 0;
}
if (timeout <= 0) {
if (timeout < 0) {
return true;
}