[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [taler-wallet-webex] 03/04: missing structuredClone caused
From: |
gnunet |
Subject: |
[GNUnet-SVN] [taler-wallet-webex] 03/04: missing structuredClone caused unintended mutations |
Date: |
Thu, 15 Aug 2019 23:34:19 +0200 |
This is an automated email from the git hooks/post-receive script.
dold pushed a commit to branch master
in repository wallet-webex.
commit 78f885db3de3901e29c6841229df03327c2943fe
Author: Florian Dold <address@hidden>
AuthorDate: Thu Aug 15 23:27:17 2019 +0200
missing structuredClone caused unintended mutations
---
packages/idb-bridge/package.json | 2 +-
packages/idb-bridge/src/MemoryBackend.ts | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/packages/idb-bridge/package.json b/packages/idb-bridge/package.json
index 940f1747..e69341c3 100644
--- a/packages/idb-bridge/package.json
+++ b/packages/idb-bridge/package.json
@@ -1,6 +1,6 @@
{
"name": "idb-bridge",
- "version": "0.0.1",
+ "version": "0.0.2",
"description": "IndexedDB implementation that uses SQLite3 as storage",
"main": "./build/index.js",
"types": "./build/index.d.ts",
diff --git a/packages/idb-bridge/src/MemoryBackend.ts
b/packages/idb-bridge/src/MemoryBackend.ts
index 9cdfd8a0..d14d63a7 100644
--- a/packages/idb-bridge/src/MemoryBackend.ts
+++ b/packages/idb-bridge/src/MemoryBackend.ts
@@ -1027,7 +1027,7 @@ export class MemoryBackend implements Backend {
if (!result) {
throw Error("invariant violated");
}
- values.push(result.value);
+ values.push(structuredClone(result.value));
}
}
} else {
@@ -1086,7 +1086,7 @@ export class MemoryBackend implements Backend {
}
if (req.resultLevel >= ResultLevel.Full) {
- values.push(res.value);
+ values.push(structuredClone(res.value));
}
numResults++;
@@ -1168,8 +1168,8 @@ export class MemoryBackend implements Backend {
}
const objectStoreRecord: ObjectStoreRecord = {
- primaryKey: key,
- value: value,
+ primaryKey: structuredClone(key),
+ value: structuredClone(value),
};
objectStore.modifiedData = modifiedData.with(key, objectStoreRecord, true);
--
To stop receiving notification emails like this one, please contact
address@hidden.