indexeddb.js
function (data) {
		if (mockIndexedDBTestFlags.canSave === true) {
			mockIndexedDBItems.push(data);
			mockIndexedDB_storeAddTimer = setTimeout(function () {
				mockIndexedDBTransaction.callCompleteHandler();
				mockIndexedDB_saveSuccess = true;
			}, 20);
		}
		else {
			mockIndexedDB_storeAddTimer = setTimeout(function () {
				mockIndexedDBTransaction.callErrorHandler();
				mockIndexedDB_saveFail = true;
			}, 20);
		}

		return mockIndexedDBTransaction;
	}
function (data) {
		if (mockIndexedDBTestFlags.canSave === true) {
			mockIndexedDBItems.push(data);
			mockIndexedDB_storeAddTimer = setTimeout(function () {
				mockIndexedDBTransaction.callCompleteHandler();
				mockIndexedDB_saveSuccess = true;
			}, 20);
		}
		else {
			mockIndexedDB_storeAddTimer = setTimeout(function () {
				mockIndexedDBTransaction.callErrorHandler();
				mockIndexedDB_saveFail = true;
			}, 20);
		}

		return mockIndexedDBTransaction;
	}
function ( data ) { if ( mockIndexedDBTestFlags . canSave === true ) { mockIndexedDBItems . push ( data ) ; mockIndexedDB_storeAddTimer = setTimeout ( function ( ) { mockIndexedDBTransaction . callCompleteHandler ( ) ; mockIndexedDB_saveSuccess = true ; } , 20 ) ; } else { mockIndexedDB_storeAddTimer = setTimeout ( function ( ) { mockIndexedDBTransaction . callErrorHandler ( ) ; mockIndexedDB_saveFail = true ; } , 20 ) ; } return mockIndexedDBTransaction ; }
add returns a different txn than delete does. in indexedDB, the listeners are attached to the txn that returned the store.
add returns a different txn than delete does . in indexedDB the listeners are attached to the txn that returned the store .