summaryrefslogtreecommitdiff
path: root/ext/kv
diff options
context:
space:
mode:
authorLuca Casonato <hello@lcas.dev>2024-05-23 00:03:35 +0200
committerGitHub <noreply@github.com>2024-05-23 00:03:35 +0200
commit971f09abe486185247e1faf4e8d1419ba2506b8d (patch)
tree3ed0cf608116ad06e88a87552333e930824cc790 /ext/kv
parent6c167c64d61ecfc912dc1b68d300f02aa3677235 (diff)
fix(runtime): use more null proto objects (#23921)
This is a primordialization effort to improve resistance against users tampering with the global `Object` prototype. --------- Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'ext/kv')
-rw-r--r--ext/kv/01_db.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/kv/01_db.ts b/ext/kv/01_db.ts
index 8917e09e0..9aa2036dd 100644
--- a/ext/kv/01_db.ts
+++ b/ext/kv/01_db.ts
@@ -210,7 +210,7 @@ class Kv {
cursor?: string;
reverse?: boolean;
consistency?: Deno.KvConsistencyLevel;
- } = {},
+ } = { __proto__: null },
): KvListIterator {
if (options.limit !== undefined && options.limit <= 0) {
throw new Error("limit must be positive");
@@ -340,7 +340,7 @@ class Kv {
finishMessageOps.clear();
}
- watch(keys: Deno.KvKey[], options = {}) {
+ watch(keys: Deno.KvKey[], options = { __proto__: null }) {
const raw = options.raw ?? false;
const rid = op_kv_watch(this.#rid, keys);
const lastEntries: (Deno.KvEntryMaybe<unknown> | undefined)[] = ArrayFrom(