1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-09-29 03:17:53 -04:00

[spidermonkey] set_timeout for sync requests is error

This commit is contained in:
Witold Filipczyk 2022-09-22 17:30:59 +02:00
parent 6b77115cb5
commit 55a302cfab

View File

@ -194,6 +194,7 @@ xhr_constructor(JSContext* ctx, unsigned argc, JS::Value* vp)
struct xhr *xhr = (struct xhr *)mem_calloc(1, sizeof(*xhr));
xhr->interpreter = interpreter;
xhr->thisval = newObj;
xhr->async = true;
JS::SetPrivate(newObj, xhr);
args.rval().setObject(*newObj);
@ -1207,6 +1208,11 @@ xhr_set_property_timeout(JSContext *ctx, unsigned int argc, JS::Value *vp)
if (!xhr) {
return false;
}
if (!xhr->async) {
return false;
}
xhr->timeout = args[0].toInt32();
return true;