зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1409641: Get the result only when it's defined in IDBtranscation. r=janv
--HG-- extra : rebase_source : 005404b167d8399263acb52021cce9222dfb7536
This commit is contained in:
Родитель
152366b300
Коммит
e66bb71c21
|
@ -160,21 +160,21 @@ IndexedDBHelper.prototype = {
|
||||||
stores = txn.objectStore(store_name);
|
stores = txn.objectStore(store_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
txn.oncomplete = function (event) {
|
txn.oncomplete = function () {
|
||||||
if (DEBUG) debug("Transaction complete. Returning to callback.");
|
if (DEBUG) debug("Transaction complete. Returning to callback.");
|
||||||
if (successCb) {
|
if (successCb) {
|
||||||
|
if ("result" in txn) {
|
||||||
successCb(txn.result);
|
successCb(txn.result);
|
||||||
|
} else {
|
||||||
|
successCb();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
txn.onabort = function (event) {
|
txn.onabort = function () {
|
||||||
if (DEBUG) debug("Caught error on transaction");
|
if (DEBUG) debug("Caught error on transaction");
|
||||||
/*
|
|
||||||
* event.target.error may be null
|
|
||||||
* if txn was aborted by calling txn.abort()
|
|
||||||
*/
|
|
||||||
if (failureCb) {
|
if (failureCb) {
|
||||||
failureCb(getErrorName(event.target.error));
|
failureCb(getErrorName(txn.error));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
callback(txn, stores);
|
callback(txn, stores);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче