jasnell · GitHub

@jasnell

legendecas

anonrig

@jasnell

@jasnell jasnell added the semver-minor

PRs that contain new features and should be released in the next minor version.

label

Apr 6, 2025

jasnell

@jasnell

mcollina

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

@jasnell

@jasnell jasnell added the author ready

PRs that have at least one approval, no pending requests for changes, and a CI started.

label

Apr 6, 2025

legendecas

Co-authored-by: Chengzhong Wu <legendecas@gmail.com>

jasnell added a commit that referenced this pull request

Apr 7, 2025
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: #57766
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>

RafaelGSS pushed a commit that referenced this pull request

May 1, 2025
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: #57766
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>

Merged

RafaelGSS pushed a commit that referenced this pull request

May 2, 2025
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: #57766
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>

mcollina pushed a commit to mcollina/node that referenced this pull request

Dec 12, 2025
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: nodejs#57766
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>

Read the original on github.com ↗