mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
[quickjs] allow timeout 0 for setTimeout
This commit is contained in:
parent
17eaef0688
commit
3837f45127
@ -310,15 +310,17 @@ js_window_setTimeout(JSContext *ctx, JSValueConst this_val, int argc, JSValueCon
|
||||
int64_t timeout = 0;
|
||||
JSValueConst func;
|
||||
|
||||
if (argc != 2) {
|
||||
if (argc < 1) {
|
||||
return JS_UNDEFINED;
|
||||
}
|
||||
|
||||
if (argc > 1) {
|
||||
if (JS_ToInt64(ctx, &timeout, argv[1])) {
|
||||
return JS_EXCEPTION;
|
||||
}
|
||||
}
|
||||
|
||||
if (timeout <= 0) {
|
||||
if (timeout < 0) {
|
||||
return JS_UNDEFINED;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user