|
@@ -59,18 +59,19 @@ addHandlers({
|
|
|
}
|
|
}
|
|
|
const { type } = msg;
|
|
const { type } = msg;
|
|
|
const upload = getOwnProp(msg, UPLOAD);
|
|
const upload = getOwnProp(msg, UPLOAD);
|
|
|
- const cb = req.cb[upload][type];
|
|
|
|
|
|
|
+ const cb = req.cb[upload ? 1 : 0][type];
|
|
|
if (!upload && type === 'loadend') {
|
|
if (!upload && type === 'loadend') {
|
|
|
delete idMap[req.id];
|
|
delete idMap[req.id];
|
|
|
}
|
|
}
|
|
|
- if (!cb && type !== ERROR)
|
|
|
|
|
- return;
|
|
|
|
|
if (hasOwnProperty(msg, ERROR)) {
|
|
if (hasOwnProperty(msg, ERROR)) {
|
|
|
msg = msg[ERROR];
|
|
msg = msg[ERROR];
|
|
|
msg = new SafeDOMException(msg[0], msg[1]);
|
|
msg = new SafeDOMException(msg[0], msg[1]);
|
|
|
if (cb) cb(msg); else log(ERROR, displayNames[req.scriptId], msg);
|
|
if (cb) cb(msg); else log(ERROR, displayNames[req.scriptId], msg);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
+ if (!cb) {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
const { data } = msg;
|
|
const { data } = msg;
|
|
|
const {
|
|
const {
|
|
|
[kResponse]: response,
|
|
[kResponse]: response,
|