Age | Commit message (Collapse) | Author |
|
Towards https://github.com/denoland/deno/issues/25269
|
|
|
|
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>
|
|
First pass of migrating away from `Deno.core.ensureFastOps()`.
A few "tricky" ones have been left for a follow up.
|
|
|
|
Enabled prefer-primordials lint for ext/cron and ext/kv.
|
|
Deno v1.39 introduces `vm.runInNewContext`. This may cause problems when
using `Object.prototype.isPrototypeOf` to check built-in types.
```js
import vm from "node:vm";
const err = new Error();
const crossErr = vm.runInNewContext(`new Error()`);
console.assert( !(crossErr instanceof Error) );
console.assert( Object.getPrototypeOf(err) !== Object.getPrototypeOf(crossErr) );
```
This PR changes to check using internal slots solves them.
---
current:
```
> import vm from "node:vm";
undefined
> vm.runInNewContext(`new Error("message")`)
Error {}
> vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`)
Date {}
```
this PR:
```
> import vm from "node:vm";
undefined
> vm.runInNewContext(`new Error("message")`)
Error: message
at <anonymous>:1:1
> vm.runInNewContext(`new Date("2018-12-10T02:26:59.002Z")`)
2018-12-10T02:26:59.002Z
```
---------
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
|
|
|
|
`opAsync` requires a lookup by name on each async call. This is a
mechanical translation of all opAsync calls to ensureFastOps.
The `opAsync` API on Deno.core will be removed at a later time.
|
|
|
|
Also reduces the time to run `kv_queue_undelivered_test.ts` test from
100 seconds down to 3 seconds.
closes #21437
|
|
If KV is closed and tries to listen queue should throw an error
closes #20991
|
|
This commit adds support for a new `kv.watch()` method that allows
watching for changes to a key-value pair. This is useful for cases
where you want to be notified when a key-value pair changes, but
don't want to have to poll for changes.
---------
Co-authored-by: losfair <zhy20000919@hotmail.com>
|
|
This commit implements Symbol.dispose and Symbol.asyncDispose for
the relevant resources.
Closes #20839
---------
Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
|
|
This fixes the `TypeError: Database closed` error during shutdown.
|
|
|
|
Co-authored-by: Luca Casonato <hello@lcas.dev>
|
|
Co-authored-by: Luca Casonato <hello@lcas.dev>
|
|
|
|
The callback draining code is no longer needed after #19513.
|
|
Extend the unstable `Deno.Kv` API to support queues.
|
|
Closes #18963
---------
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
|
|
`new Deno.KvU64(1n) + 2n == 3n` is now true.
`new Deno.KvU64(1n)` is now inspected as `[Deno.KvU64: 1n]`
(`Object(1n)` is inspected as `[BigInt: 1n]`).
---------
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
|
|
|
|
|
|
Co-authored-by: losfair <zhy20000919@hotmail.com>
Co-authored-by: Luca Casonato <hello@lcas.dev>
|
|
This causes `DCHECK` fail in V8 when pointer compression
is disabled.
|
|
|
|
There was some leftover code from previous iterations, where keys could
be single parts instead of arrays also. This didn't match the types.
|
|
|
|
This commit updates the `Deno.Kv` API to return the new commited
versionstamp for the mutated data from `db.set` and `ao.commit`. This is
returned in the form of a `Deno.KvCommitResult` object that has a
`versionstamp` property.
|
|
|
|
The `getMany` method was missing from the implementation of the
`Deno.Kv` class. This patch fixes it.
|
|
This reverts commit 50b793c9ed866ee29e8f04b4fa24b485b01a2b74.
|
|
|
|
This commit adds unstable "Deno.openKv()" API that allows to open
a key-value database at a specified path.
---------
Co-authored-by: Luca Casonato <hello@lcas.dev>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
|