indexeddbshim 17.3.0 → 17.3.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/dist/IDBFactory.d.ts.map +1 -1
- package/dist/indexeddbshim-Key.js +1 -1
- package/dist/indexeddbshim-Key.min.js +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs +35 -4
- package/dist/indexeddbshim-UnicodeIdentifiers-node.cjs.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.js +35 -4
- package/dist/indexeddbshim-UnicodeIdentifiers.js.map +1 -1
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js +2 -2
- package/dist/indexeddbshim-UnicodeIdentifiers.min.js.map +1 -1
- package/dist/indexeddbshim-node.cjs +35 -4
- package/dist/indexeddbshim-node.cjs.map +1 -1
- package/dist/indexeddbshim-noninvasive.js +35 -4
- package/dist/indexeddbshim-noninvasive.js.map +1 -1
- package/dist/indexeddbshim-noninvasive.min.js +2 -2
- package/dist/indexeddbshim-noninvasive.min.js.map +1 -1
- package/dist/indexeddbshim.js +35 -4
- package/dist/indexeddbshim.js.map +1 -1
- package/dist/indexeddbshim.min.js +2 -2
- package/dist/indexeddbshim.min.js.map +1 -1
- package/dist/setGlobalVars.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/IDBFactory.js +16 -1
- package/src/setGlobalVars.js +18 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setGlobalVars.d.ts","sourceRoot":"","sources":["../src/setGlobalVars.js"],"names":[],"mappings":";;uBAkBa,GAAG;+BAKL,OAAO,UAAU,EAAE,iBAAiB,GAC1C,OAAO,CAAC,OAAO,UAAU,EAAE,YAAY,CAAC,QAClC,QAAQ;wBAoCN,CACR,IAAI,EAAE,OAAO,UAAU,EAAE,iBAAiB,KACvC,OAAO,UAAU,EAAE,WAAW;oCAIzB,CAAC,GAAG,EAAE;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB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|
@@ -668,7 +668,22 @@ IDBFactory.prototype.open = function (name /* , version */) {
|
|
|
668
668
|
// open/close the transaction's active-handler window itself.
|
|
669
669
|
req.transaction.__handlerActive = true;
|
|
670
670
|
req.dispatchEvent(e);
|
|
671
|
-
|
|
671
|
+
// Give any same-tick microtask scheduled from within the
|
|
672
|
+
// `upgradeneeded` handler (e.g. a plain
|
|
673
|
+
// `Promise.resolve().then(...)`) a chance to run -- and still
|
|
674
|
+
// observe the transaction as active -- before we deactivate it
|
|
675
|
+
// again, per https://github.com/w3c/IndexedDB/issues/87. Only
|
|
676
|
+
// the flag reset itself is deferred here -- unlike
|
|
677
|
+
// `IDBTransaction.js`'s `advanceAfterDispatch`, `finished()`
|
|
678
|
+
// (this transaction's own queue-advancement/completion signal)
|
|
679
|
+
// still runs synchronously, at exactly its previous timing: an
|
|
680
|
+
// earlier attempt at deferring `finished()` too raced against
|
|
681
|
+
// unrelated test setup that assumed a freshly deleted/created
|
|
682
|
+
// database's upgrade transaction had already fully completed by
|
|
683
|
+
// the time this function returns.
|
|
684
|
+
queueMicrotask(() => {
|
|
685
|
+
req.transaction.__handlerActive = false;
|
|
686
|
+
});
|
|
672
687
|
|
|
673
688
|
if (e.__legacyOutputDidListenersThrowError) {
|
|
674
689
|
logError('Error', 'An error occurred in an upgradeneeded handler attached to request chain', /** @type {Error} */ (e.__legacyOutputDidListenersThrowError)); // We do nothing else with this error as per spec
|
package/src/setGlobalVars.js
CHANGED
|
@@ -274,8 +274,24 @@ function setGlobalVars (idb, initialConfig) {
|
|
|
274
274
|
Object.setPrototypeOf(shimIDBRequest, ShimEventTarget);
|
|
275
275
|
Object.setPrototypeOf(shimIDBTransaction, ShimEventTarget);
|
|
276
276
|
Object.setPrototypeOf(shimIDBVersionChangeEvent, ShimEvent);
|
|
277
|
-
|
|
278
|
-
|
|
277
|
+
// `ShimDOMException` is the real native `DOMException` when one
|
|
278
|
+
// is available (see `DOMException.js`'s `useNativeDOMException`)
|
|
279
|
+
// -- which, unlike the shim classes above, is a single,
|
|
280
|
+
// process-wide singleton shared by reference across every
|
|
281
|
+
// sandbox this library gets installed into (see
|
|
282
|
+
// `node-idb-test.js`'s `sandboxObj`). A native `DOMException`
|
|
283
|
+
// already has the correct prototype chain out of the box
|
|
284
|
+
// (`Object.getPrototypeOf(DOMException) === Function.prototype`,
|
|
285
|
+
// not `Error`), so forcing it here isn't just unneeded but
|
|
286
|
+
// actively wrong -- and, because it's shared, permanently
|
|
287
|
+
// wrong for every later use of `DOMException` in the same
|
|
288
|
+
// process (e.g. a later WPT test file's own idlharness-style
|
|
289
|
+
// check that `DOMException` does *not* inherit from `Error`
|
|
290
|
+
// on the class side), not just this one shim install.
|
|
291
|
+
if (typeof DOMException === 'undefined' || ShimDOMException !== DOMException) {
|
|
292
|
+
Object.setPrototypeOf(ShimDOMException, Error);
|
|
293
|
+
Object.setPrototypeOf(ShimDOMException.prototype, Error.prototype);
|
|
294
|
+
}
|
|
279
295
|
}
|
|
280
296
|
if (IDB.indexedDB && !IDB.indexedDB.toString().includes('[native code]')) {
|
|
281
297
|
if (CFG.addNonIDBGlobals) {
|