GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — domain: port to AsyncLocalStorage · nodejs/node@2c4356c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • deprecations.md
    • errors.md
  • lib
    • async_hooks.js
    • domain.js
    • internal
      • async_hooks.js
      • errors.js
  • test
    • addons
      • make-callback-domain-warning
        • binding.cc
        • binding.gyp
        • test.js
      • make-callback-recurse
        • test.js
    • node-api/test_make_callback_recurse
      • test.js
    • parallel
      • test-domain-async-id-map-leak.js
      • test-domain-async-resource-domain-removed.js
      • test-domain-dep0097.js
      • test-domain-emit-error-handler-stack.js
      • test-domain-error-handler-throw-no-recursion.js
      • test-domain-stack-empty-in-process-uncaughtexception.js
      • test-repl-top-level-await.js
      • test-timers-reset-process-domain-on-throw.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/deprecations.md‎

Copy file name to clipboardExpand all lines: doc/api/deprecations.md
+8-4Lines changed: 8 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2297,16 +2297,20 @@ Type: End-of-Life
22972297

22982298
<!-- YAML
22992299
changes:
2300+
- version: REPLACEME
2301+
pr-url: https://github.com/nodejs/node/pull/61095
2302+
description: End-of-Life.
23002303
- version: v10.0.0
23012304
pr-url: https://github.com/nodejs/node/pull/17417
23022305
description: Runtime deprecation.
23032306
-->
23042307

2305-
Type: Runtime
2308+
Type: End-of-Life
23062309

2307-
Users of `MakeCallback` that add the `domain` property to carry context,
2308-
should start using the `async_context` variant of `MakeCallback` or
2309-
`CallbackScope`, or the high-level `AsyncResource` class.
2310+
The `domain` property on async resources and `MakeCallback` has been removed.
2311+
The domain module now uses `AsyncLocalStorage` for context propagation instead
2312+
of `async_hooks`. Accessing the `domain` property on `AsyncResource` will throw
2313+
an error. Use `AsyncLocalStorage` instead for context propagation.
23102314

23112315
### DEP0098: AsyncHooks embedder `AsyncResource.emitBefore` and `AsyncResource.emitAfter` APIs
23122316

Collapse file

‎doc/api/errors.md‎

Copy file name to clipboardExpand all lines: doc/api/errors.md
+8Lines changed: 8 additions & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,14 @@ An attempt was made to register something that is not a function as an
714714
An operation related to module loading is customized by an asynchronous loader
715715
hook that never settled the promise before the loader thread exits.
716716

717+
<a id="ERR_ASYNC_RESOURCE_DOMAIN_REMOVED"></a>
718+
719+
### `ERR_ASYNC_RESOURCE_DOMAIN_REMOVED`
720+
721+
The `domain` property on `AsyncResource` has been removed. The domain module
722+
now uses `AsyncLocalStorage` for context propagation instead of `async_hooks`.
723+
Use `AsyncLocalStorage` instead for context propagation.
724+
717725
<a id="ERR_ASYNC_TYPE"></a>
718726

719727
### `ERR_ASYNC_TYPE`
Collapse file

‎lib/async_hooks.js‎

Copy file name to clipboardExpand all lines: lib/async_hooks.js
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const {
1616

1717
const {
1818
ERR_ASYNC_CALLBACK,
19+
ERR_ASYNC_RESOURCE_DOMAIN_REMOVED,
1920
ERR_ASYNC_TYPE,
2021
ERR_INVALID_ASYNC_ID,
2122
ERR_INVALID_ARG_TYPE,
@@ -275,6 +276,10 @@ class AsyncResource {
275276
type ||= fn.name;
276277
return (new AsyncResource(type || 'bound-anonymous-fn')).bind(fn, thisArg);
277278
}
279+
280+
get domain() {
281+
throw new ERR_ASYNC_RESOURCE_DOMAIN_REMOVED();
282+
}
278283
}
279284

280285
// Placing all exports down here because the exported classes won't export

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.