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,4 +1,4 @@
|
|
|
1
|
-
/*! indexeddbshim - v17.3.
|
|
1
|
+
/*! indexeddbshim - v17.3.1 - 8/24/2026 */
|
|
2
2
|
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -10443,7 +10443,22 @@ IDBFactory.prototype.open = function (name /* , version */) {
|
|
|
10443
10443
|
// open/close the transaction's active-handler window itself.
|
|
10444
10444
|
req.transaction.__handlerActive = true;
|
|
10445
10445
|
req.dispatchEvent(e);
|
|
10446
|
-
|
|
10446
|
+
// Give any same-tick microtask scheduled from within the
|
|
10447
|
+
// `upgradeneeded` handler (e.g. a plain
|
|
10448
|
+
// `Promise.resolve().then(...)`) a chance to run -- and still
|
|
10449
|
+
// observe the transaction as active -- before we deactivate it
|
|
10450
|
+
// again, per https://github.com/w3c/IndexedDB/issues/87. Only
|
|
10451
|
+
// the flag reset itself is deferred here -- unlike
|
|
10452
|
+
// `IDBTransaction.js`'s `advanceAfterDispatch`, `finished()`
|
|
10453
|
+
// (this transaction's own queue-advancement/completion signal)
|
|
10454
|
+
// still runs synchronously, at exactly its previous timing: an
|
|
10455
|
+
// earlier attempt at deferring `finished()` too raced against
|
|
10456
|
+
// unrelated test setup that assumed a freshly deleted/created
|
|
10457
|
+
// database's upgrade transaction had already fully completed by
|
|
10458
|
+
// the time this function returns.
|
|
10459
|
+
queueMicrotask(() => {
|
|
10460
|
+
req.transaction.__handlerActive = false;
|
|
10461
|
+
});
|
|
10447
10462
|
if (e.__legacyOutputDidListenersThrowError) {
|
|
10448
10463
|
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
|
|
10449
10464
|
req.transaction.__abortTransaction(createDOMException('AbortError', 'A request was aborted.'));
|
|
@@ -12480,8 +12495,24 @@ function setGlobalVars(idb, initialConfig) {
|
|
|
12480
12495
|
Object.setPrototypeOf(IDBRequest, EventTarget);
|
|
12481
12496
|
Object.setPrototypeOf(IDBTransaction, EventTarget);
|
|
12482
12497
|
Object.setPrototypeOf(IDBVersionChangeEvent, ShimEvent);
|
|
12483
|
-
|
|
12484
|
-
|
|
12498
|
+
// `ShimDOMException` is the real native `DOMException` when one
|
|
12499
|
+
// is available (see `DOMException.js`'s `useNativeDOMException`)
|
|
12500
|
+
// -- which, unlike the shim classes above, is a single,
|
|
12501
|
+
// process-wide singleton shared by reference across every
|
|
12502
|
+
// sandbox this library gets installed into (see
|
|
12503
|
+
// `node-idb-test.js`'s `sandboxObj`). A native `DOMException`
|
|
12504
|
+
// already has the correct prototype chain out of the box
|
|
12505
|
+
// (`Object.getPrototypeOf(DOMException) === Function.prototype`,
|
|
12506
|
+
// not `Error`), so forcing it here isn't just unneeded but
|
|
12507
|
+
// actively wrong -- and, because it's shared, permanently
|
|
12508
|
+
// wrong for every later use of `DOMException` in the same
|
|
12509
|
+
// process (e.g. a later WPT test file's own idlharness-style
|
|
12510
|
+
// check that `DOMException` does *not* inherit from `Error`
|
|
12511
|
+
// on the class side), not just this one shim install.
|
|
12512
|
+
if (typeof DOMException === 'undefined' || ShimDOMException !== DOMException) {
|
|
12513
|
+
Object.setPrototypeOf(ShimDOMException, Error);
|
|
12514
|
+
Object.setPrototypeOf(ShimDOMException.prototype, Error.prototype);
|
|
12515
|
+
}
|
|
12485
12516
|
}
|
|
12486
12517
|
if (IDB.indexedDB && !IDB.indexedDB.toString().includes('[native code]')) {
|
|
12487
12518
|
if (CFG.addNonIDBGlobals) {
|