Files
node/lib
James M Snell a369818b1e lib: add defaultValue and name options to AsyncLocalStorage
The upcoming `AsyncContext` specification adds a default value and name
to async storage variables. This adds the same to `AsyncLocalStorage`
to promote closer alignment with the pending spec.

```js
const als = new AsyncLocalStorage({
  name: 'foo',
  defaultValue: 123,
});

console.log(als.name);  // 'foo'
console.log(als.getStore());  // 123
```

Refs: https://github.com/tc39/proposal-async-context/blob/master/spec.html
PR-URL: https://github.com/nodejs/node/pull/57766
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2025-04-07 13:41:18 -07:00
..
…
…
…
…
2024-09-24 19:48:15 +00:00
2024-10-09 06:42:16 +00:00
2025-03-04 08:33:21 -08:00
2024-12-15 14:19:27 +00:00
…
2024-07-08 15:55:43 +00:00
2024-10-09 06:42:16 +00:00
2024-10-09 06:42:16 +00:00
2025-04-05 13:40:18 +00:00
…
2025-01-04 18:30:04 +00:00
2025-02-01 02:13:57 +00:00
2025-03-04 11:14:34 +00:00
…