dexie 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bower.json +1 -1
- package/dist/dexie.d.ts +1 -1
- package/dist/dexie.es6.js +20 -22
- package/dist/dexie.es6.js.map +1 -1
- package/dist/dexie.js +25 -28
- package/dist/dexie.js.map +1 -1
- package/dist/dexie.min.js +2 -2
- package/dist/dexie.min.js.map +1 -1
- package/package.json +1 -1
- package/src/Dexie.js +17 -19
- package/test/tests-misc.js +12 -0
package/bower.json
CHANGED
package/dist/dexie.d.ts
CHANGED
package/dist/dexie.es6.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
* By David Fahlander, david.fahlander@gmail.com
|
|
6
6
|
*
|
|
7
|
-
* Version 1.5.
|
|
7
|
+
* Version 1.5.1, Tue Nov 01 2016
|
|
8
8
|
* www.dexie.com
|
|
9
9
|
* Apache License Version 2.0, January 2004, http://www.apache.org/licenses/
|
|
10
10
|
*/
|
|
@@ -1417,14 +1417,14 @@ function rejection (err, uncaughtHandler) {
|
|
|
1417
1417
|
*
|
|
1418
1418
|
* By David Fahlander, david.fahlander@gmail.com
|
|
1419
1419
|
*
|
|
1420
|
-
* Version 1.5.
|
|
1420
|
+
* Version 1.5.1, Tue Nov 01 2016
|
|
1421
1421
|
*
|
|
1422
1422
|
* http://dexie.org
|
|
1423
1423
|
*
|
|
1424
1424
|
* Apache License Version 2.0, January 2004, http://www.apache.org/licenses/
|
|
1425
1425
|
*/
|
|
1426
1426
|
|
|
1427
|
-
var DEXIE_VERSION = '1.5.
|
|
1427
|
+
var DEXIE_VERSION = '1.5.1';
|
|
1428
1428
|
var maxString = String.fromCharCode(65535);
|
|
1429
1429
|
var maxKey = (function(){try {IDBKeyRange.only([[]]);return [[]];}catch(e){return maxString;}})();
|
|
1430
1430
|
var INVALID_KEY_ARGUMENT = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.";
|
|
@@ -2768,8 +2768,8 @@ function Dexie(dbName, options) {
|
|
|
2768
2768
|
if (--this._reculock === 0) {
|
|
2769
2769
|
if (!PSD.global) PSD.lockOwnerFor = null;
|
|
2770
2770
|
while (this._blockedFuncs.length > 0 && !this._locked()) {
|
|
2771
|
-
var
|
|
2772
|
-
try {
|
|
2771
|
+
var fnAndPSD = this._blockedFuncs.shift();
|
|
2772
|
+
try { usePSD(fnAndPSD[1], fnAndPSD[0]); } catch (e) { }
|
|
2773
2773
|
}
|
|
2774
2774
|
}
|
|
2775
2775
|
return this;
|
|
@@ -2824,31 +2824,29 @@ function Dexie(dbName, options) {
|
|
|
2824
2824
|
},
|
|
2825
2825
|
_promise: function (mode, fn, bWriteLock) {
|
|
2826
2826
|
var self = this;
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2827
|
+
var p = self._locked() ?
|
|
2828
|
+
// Read lock always. Transaction is write-locked. Wait for mutex.
|
|
2829
|
+
new Promise(function (resolve, reject) {
|
|
2830
|
+
self._blockedFuncs.push([function () {
|
|
2831
|
+
self._promise(mode, fn, bWriteLock).then(resolve, reject);
|
|
2832
|
+
}, PSD]);
|
|
2833
|
+
}) :
|
|
2834
|
+
newScope(function() {
|
|
2835
|
+
var p_ = self.active ? new Promise(function (resolve, reject) {
|
|
2832
2836
|
if (mode === READWRITE && self.mode !== READWRITE)
|
|
2833
2837
|
throw new exceptions.ReadOnly("Transaction is readonly");
|
|
2834
2838
|
if (!self.idbtrans && mode) self.create();
|
|
2835
2839
|
if (bWriteLock) self._lock(); // Write lock if write operation is requested
|
|
2836
2840
|
fn(resolve, reject, self);
|
|
2837
2841
|
}) : rejection(new exceptions.TransactionInactive());
|
|
2838
|
-
if (self.active && bWriteLock)
|
|
2842
|
+
if (self.active && bWriteLock) p_.finally(function () {
|
|
2839
2843
|
self._unlock();
|
|
2840
2844
|
});
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
});
|
|
2847
|
-
});
|
|
2848
|
-
}
|
|
2849
|
-
p._lib = true;
|
|
2850
|
-
return p.uncaught(dbUncaught);
|
|
2851
|
-
});
|
|
2845
|
+
return p_;
|
|
2846
|
+
});
|
|
2847
|
+
|
|
2848
|
+
p._lib = true;
|
|
2849
|
+
return p.uncaught(dbUncaught);
|
|
2852
2850
|
},
|
|
2853
2851
|
|
|
2854
2852
|
//
|