Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
dfcd06d
domain: implement node:domain on AsyncLocalStorage and port the upstr…
cirospaciari Jun 4, 2026
c422740
domain: fix --abort-on-uncaught-exception on Windows and in Workers
cirospaciari Jun 5, 2026
dc480be
domain: skip remaining main-module-throw domain tests on Windows
cirospaciari Jun 5, 2026
2edbcb0
domain: fix EventEmitter captureRejections bypass and async pairing leak
cirospaciari Jun 5, 2026
4a1c169
runtime: don't arm the forever timer for a handled entry-point error
cirospaciari Jun 5, 2026
baa8e1d
test: review cleanups for the domain integration tests
cirospaciari Jun 5, 2026
17fb9a9
process: only abort unhandled rejections after listeners decline
cirospaciari Jun 6, 2026
9d66c3e
test: disable core dumps for the intentionally-aborting rejection child
cirospaciari Jun 6, 2026
9658a11
domain: cover pre-load captureRejections emitters and write-first set…
cirospaciari Jun 6, 2026
dc33ddb
Merge branch 'main' into claude/port-node-domain-tests
robobun Jun 10, 2026
58713fa
domain: address review feedback
alii Jul 7, 2026
52d415c
process: abort unhandled rejections before listeners under --abort-on…
alii Jul 8, 2026
32966e9
Merge branch 'main' into claude/port-node-domain-tests
alii Jul 8, 2026
a11bc05
domain: address review comments — re-read capture callback after moni…
alii Jul 8, 2026
00e3c82
[autofix.ci] apply automated fixes
autofix-ci[bot] Jul 8, 2026
58aa451
domain: sync stale abort-ordering doc comments and use stderr self-ma…
alii Jul 8, 2026
2c83ab0
domain: decide --abort-on-uncaught-exception at throw time and route …
alii Jul 9, 2026
2f28b5a
[autofix.ci] apply automated fixes
autofix-ci[bot] Jul 9, 2026
1dc9f3c
Merge remote-tracking branch 'origin/main' into HEAD
alii Jul 10, 2026
111dd2a
domain: report handled once _errorHandler is invoked; log after Worke…
alii Jul 10, 2026
7f350cd
Merge branch 'main' into claude/port-node-domain-tests
cirospaciari Jul 14, 2026
7707c06
Merge origin/main into claude/port-node-domain-tests
cirospaciari Jul 14, 2026
5746e70
vm: pass substitute out-param via raw pointer to satisfy clippy::borr…
cirospaciari Jul 14, 2026
77c2456
Merge origin/main into claude/port-node-domain-tests
cirospaciari Jul 15, 2026
2dd9144
domain: consume a throw-time domain snapshot in the fallback abort gate
cirospaciari Jul 15, 2026
402c892
domain: enter the paired domain for callbacks scheduled by the proces…
cirospaciari Jul 15, 2026
0e6925a
test(domain): skip the abort-expecting node differential on Windows
cirospaciari Jul 15, 2026
76623b3
Merge remote-tracking branch 'origin/main' into claude/port-node-doma…
robobun Jul 16, 2026
56873fb
Merge branch 'main' into claude/port-node-domain-tests
robobun Jul 16, 2026
3b9cbb1
domain: keep non-Domain process.domain values off the adopted stack
robobun Jul 16, 2026
1a6b004
[autofix.ci] apply automated fixes
autofix-ci[bot] Jul 16, 2026
ac91edb
test: opt two worker-termination node tests out of dumpSimulatedThrows
robobun Jul 16, 2026
ef26dcd
Revert "test: opt two worker-termination node tests out of dumpSimula…
robobun Jul 16, 2026
944aa88
Merge origin/main into claude/port-node-domain-tests
robobun Jul 17, 2026
9ebd432
events: route EventEmitterAsyncResource.emit through the single proto…
robobun Jul 17, 2026
2eba49c
Merge origin/main into claude/port-node-domain-tests
robobun Jul 19, 2026
3512890
test: quarantine test-gc-http-client-connaborted.js on linux-x64-musl
robobun Jul 19, 2026
5267fc2
cli: hide --abort_on_uncaught_exception from --help; drop the connabo…
robobun Jul 19, 2026
596d276
Merge branch 'main' into claude/port-node-domain-tests
cirospaciari Jul 20, 2026
d4fb355
Merge branch 'main' into claude/port-node-domain-tests [allow size]
robobun Jul 24, 2026
50610ee
Merge branch 'main' into claude/port-node-domain-tests
cirospaciari Jul 24, 2026
03a2714
Merge branch 'main' into claude/port-node-domain-tests [allow size]
robobun Jul 24, 2026
a479a59
[autofix.ci] apply automated fixes
autofix-ci[bot] Jul 24, 2026
5d72c65
domain: filter non-Domain process.domain values out of the wrapped Ev…
robobun Jul 24, 2026
e741b75
domain: make exports._stack and exports.active configurable like proc…
robobun Jul 24, 2026
5e56ff2
Merge origin/main into claude/port-node-domain-tests
robobun Aug 3, 2026
16e1f75
async_hooks: use a null-prototype descriptor for the AsyncResource .d…
robobun Aug 3, 2026
dfe9e79
domain,events,async_hooks,BunProcess: trim every PR-added comment to …
robobun Aug 3, 2026
1172a20
vm: move UncaughtExceptionOrigin above the FFI section so the JSGloba…
robobun Aug 3, 2026
0f08781
Merge remote-tracking branch 'origin/main' into claude/port-node-doma…
robobun Aug 3, 2026
e5fb274
test: suppress crash reporting for intentional --abort-on-uncaught-ex…
robobun Aug 4, 2026
82c7d9f
Merge remote-tracking branch 'origin/main' into claude/port-node-doma…
robobun Aug 4, 2026
f5deb89
cleanupAsyncHooksData: skip the drain when no ticks are pending
robobun Aug 7, 2026
bd35aa8
Merge remote-tracking branch 'origin/main' into claude/port-node-doma…
robobun Aug 7, 2026
08718bc
ci: retrigger
robobun Aug 7, 2026
c641f3f
Merge branch 'main' into port-node-domain-tests
cirospaciari Aug 7, 2026
5685211
test-domain-promise: cite the upstream source for the omitted block
cirospaciari Aug 7, 2026
6fc8040
Address review: null-guard the fatal-path stack walk, restore upstrea…
robobun Aug 7, 2026
413bb58
[autofix.ci] apply automated fixes
autofix-ci[bot] Aug 7, 2026
9f5ea3f
process.allowedNodeEnvironmentFlags: include --abort-on-uncaught-exce…
robobun Aug 7, 2026
a0b52c9
process._fatalException: log a Worker handler's own throw instead of …
robobun Aug 7, 2026
61ca03f
domain: retire the live token at every tick boundary, not just the pr…
robobun Aug 7, 2026
93a7dd0
domain: point the token-retire comment at node's after() hook, drop a…
robobun Aug 7, 2026
a9a46e4
Trim comments to node-source/spec references
robobun Aug 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/js/builtins/ProcessObjectInternals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,7 @@ export function buildAllowedNodeEnvironmentFlags() {
// https://github.com/nodejs/node/blob/main/lib/internal/process/per_thread.js buildAllowedFlags:
// a frozen Set whose has() normalizes _→-, missing dashes, and =value suffixes.
const canonical = [
"--abort-on-uncaught-exception",
"--conditions",
"--diagnostic-dir",
"--disable-warning",
Expand Down
20 changes: 20 additions & 0 deletions src/js/node/async_hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ function sameValue(a, b) {
return a !== a && b !== b;
}

let domainActiveGetter: (() => any) | null = null;

// Only run during debug
function assertValidAsyncContextArray(array: unknown): array is ReadonlyArray<any> | undefined {
// undefined is OK
Expand Down Expand Up @@ -376,6 +378,19 @@ class AsyncResource {
this.type = type;
this.#snapshot = get();
this.#triggerAsyncId = triggerAsyncId;

if (domainActiveGetter !== null) {
const domain = domainActiveGetter();
if (domain != null) {
Object.defineProperty(this, "domain", {
__proto__: null,
configurable: true,
enumerable: false,
value: domain,
writable: true,
});
Comment thread
robobun marked this conversation as resolved.
}
}
}

emitBefore() {
Expand Down Expand Up @@ -614,6 +629,8 @@ const asyncWrapProviders = {
INSPECTORJSBINDING: 57,
};

const kSetDomainActiveGetter = Symbol.for("::bunternal::async_hooks.setDomainActiveGetter");

export default {
AsyncLocalStorage,
createHook,
Expand All @@ -622,4 +639,7 @@ export default {
executionAsyncResource,
asyncWrapProviders,
AsyncResource,
[kSetDomainActiveGetter](fn: () => any) {
domainActiveGetter = fn;
},
};
Loading