mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
[spidermonkey] set_timeout for sync requests is error
This commit is contained in:
parent
6b77115cb5
commit
55a302cfab
@ -194,6 +194,7 @@ xhr_constructor(JSContext* ctx, unsigned argc, JS::Value* vp)
|
|||||||
struct xhr *xhr = (struct xhr *)mem_calloc(1, sizeof(*xhr));
|
struct xhr *xhr = (struct xhr *)mem_calloc(1, sizeof(*xhr));
|
||||||
xhr->interpreter = interpreter;
|
xhr->interpreter = interpreter;
|
||||||
xhr->thisval = newObj;
|
xhr->thisval = newObj;
|
||||||
|
xhr->async = true;
|
||||||
JS::SetPrivate(newObj, xhr);
|
JS::SetPrivate(newObj, xhr);
|
||||||
args.rval().setObject(*newObj);
|
args.rval().setObject(*newObj);
|
||||||
|
|
||||||
@ -1207,6 +1208,11 @@ xhr_set_property_timeout(JSContext *ctx, unsigned int argc, JS::Value *vp)
|
|||||||
if (!xhr) {
|
if (!xhr) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!xhr->async) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
xhr->timeout = args[0].toInt32();
|
xhr->timeout = args[0].toInt32();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user