workerd / dom-exception
AGENTS.md9.2k starsChanged 8 months agoApache-2.0View on GitHub
An informal specification of DOMException as implemented in workerd, kept in lockstep with the test suite in this directory. The tests are the normative artifact. The cells run the same modules (dom-exception-modules.capnp): which-impl.js reads the flags; a cell's USING_TS_IMPL binding says which implementation it means to run. The C++ cells have no @all-autogates variant, since enabling every autogate enables TS_DOM_EXCEPTION. Every cell needs --experimental, for service_binding_extra_handlers (crafted payloads through Fetcher.queue()), enable_web_file_system and enable_abortsignal_rpc. What JavaScript cannot see is pinned in…
Trending
More talk lately.about the whole repository
Who's talking about cloudflare/workerd
- A Hacker News story“OS Workerd, Cloudflare's JavaScript/WASM Runtime”Hacker News · Sep 27, 2022 · 27 points
- withastro/astro“Cloudflare adapter returning [object Object]”GitHub · Oct 10, 2025 · 18 reactions
- supabase/supabase-js“The 'cache' field on 'RequestInitializerDict' is not implemented - Cloudflare Workers”GitHub · Mar 28, 2024 · 16 reactions
- NixOS/nixpkgs“Package request: workerd”GitHub · Nov 12, 2024 · 13 reactions
- nodejs/node“src: improve buffer.transcode performance”GitHub · Aug 1, 2024 · 13 reactions
The biggest 5 of 39 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 39
Talked about on GitHub, Bluesky, Hacker News and Stack Overflow (39 times).
On GitHub · 32
- Oct 10, 2025Cloudflare adapter returning [object Object] — withastro/astro18 reactions · 15 comments
- Mar 28, 2024The 'cache' field on 'RequestInitializerDict' is not implemented - Cloudflare Workers — supabase/supabase-js16 reactions · 24 comments
- Nov 12, 2024Package request: workerd — NixOS/nixpkgs13 reactions · 10 comments
- Aug 1, 2024src: improve buffer.transcode performance — nodejs/node13 reactions · 26 comments
- Feb 19, 2024Add Curve25519 — w3c/webcrypto9 reactions · 16 comments
27 more on GitHub
- Nov 3, 2025Optimize TextEncoder::encode — nodejs/performance7 reactions · 33 comments
- Oct 23, 2023🐛 BUG: pages dev output is unnecessarily verbose — cloudflare/workers-sdk7 reactions · 7 comments
- Nov 24, 2025util: improve textencoder encodeInto performance — nodejs/node6 reactions · 8 comments
- Aug 8, 2024Fix fetch adapter in cloudflare workers — axios/axios6 reactions · 1 comment
- May 25, 2024Partially fix #3160 by properly handling resultsFormat query — cloudflare/workers-sdk6 reactions · 12 comments
- Jan 23, 2026src: improve textEncoder encode performance with simdutf — nodejs/node5 reactions · 8 comments
- Jan 19, 2024Implement Vitest testing environment for Miniflare 3 — cloudflare/workers-sdksays it tested it5 reactions · 7 comments
- Nov 28, 2024src,lib: remove the cost of encoding parameter serialization — nodejs/node4 reactions · 3 comments
- Aug 8, 2026deps: bump the npm group in /kanarek-companion with 2 updates — trvny/trvny3 reactions · 4 comments
- Aug 8, 2026deps: bump the npm group in /weather-feed with 3 updates — trvny/trvny3 reactions · 4 comments
- Aug 8, 2026deps: bump the npm group in /mcp/status-mcp with 2 updates — trvny/trvny3 reactions · 4 comments
- Jan 24, 2026build(deps-dev): bump @cloudflare/workers-types from 4.20260123.0 to 4.20260124.0 — magicappdev/magicappdev3 reactions · 5 comments
- Nov 15, 2026chore(deps-dev): bump @cloudflare/workers-types from 5.20260821.1 to 5.20261112.1 — paglaai/PaglaROUTER2 reactions · 2 comments
- Nov 8, 2026chore(deps-dev): bump @cloudflare/workers-types from 5.20260821.1 to 5.20261104.1 — paglaai/PaglaROUTER2 reactions · 3 comments
- Nov 1, 2026chore(deps-dev): bump @cloudflare/workers-types from 5.20260821.1 to 5.20261029.1 — paglaai/PaglaROUTER2 reactions · 3 comments
- Oct 25, 2026chore(deps-dev): bump @cloudflare/workers-types from 5.20260821.1 to 5.20261022.1 — paglaai/PaglaROUTER2 reactions · 3 comments
- Oct 18, 2026chore(deps-dev): bump @cloudflare/workers-types from 5.20260821.1 to 5.20261015.1 — paglaai/PaglaROUTER2 reactions · 3 comments
- Oct 11, 2026chore(deps-dev): bump @cloudflare/workers-types from 5.20260821.1 to 5.20261008.1 — paglaai/PaglaROUTER2 reactions · 4 comments
- Oct 4, 2026chore(deps-dev): bump @cloudflare/workers-types from 5.20260821.1 to 5.20261001.1 — paglaai/PaglaROUTER2 reactions · 4 comments
- Sep 27, 2026chore(deps-dev): bump @cloudflare/workers-types from 5.20260821.1 to 5.20260924.1 — paglaai/PaglaROUTER2 reactions · 4 comments
- Sep 20, 2026chore(deps-dev): bump @cloudflare/workers-types from 5.20260821.1 to 5.20260917.1 — paglaai/PaglaROUTER2 reactions · 3 comments
- Sep 16, 2026[wrangler] Add Analytics SQL binding support — cloudflare/workers-sdk2 reactions · 4 comments
- Sep 13, 2026chore(deps-dev): bump @cloudflare/workers-types from 5.20260821.1 to 5.20260910.1 — paglaai/PaglaROUTER2 reactions · 4 comments
- Apr 21, 2026build(deps-dev): Bump @cloudflare/workers-types from 4.20260411.1 to 4.20260421.1 in /workers/auth-api — Trancendos/infinity-adminOS2 reactions · 4 comments
- Apr 14, 2026build(deps-dev): Bump @cloudflare/workers-types from 4.20260411.1 to 4.20260414.1 in /workers/ai-api — Trancendos/infinity-adminOS2 reactions · 4 comments
- Apr 14, 2026build(deps-dev): Bump @cloudflare/workers-types from 4.20260411.1 to 4.20260414.1 in /workers/files-api — Trancendos/infinity-adminOS2 reactions · 4 comments
- Jan 24, 2026build(deps-dev): bump @cloudflare/workers-types from 4.20260123.0 to 4.20260124.0 — magicappdev/templates2 reactions · 2 comments
On Bluesky · 4
- Mar 24, 2026workerd : le runtime JavaScript/Wasm open source de Cloudflare Workers — @news.humancoders.com4 likes and reposts
- Aug 22, 2026Current status: trying to build github.com/cloudflare/w... on various sandbox providers — @jeremymorrell.dev1 likes and repost
- Mar 24, 2026workerd : le runtime JavaScript/Wasm qui propulse Cloudflare Workers est maintenant open source. Basé sur les standards web, il permet… — @humancoders.com1 likes and repost
- Nov 5, 2024Technically workers are open source github.com/cloudflare/w... — @userops.bsky.social1 likes and repost
On Hacker News · 2
- Sep 27, 2022OS Workerd, Cloudflare's JavaScript/WASM Runtime27 points · 2 comments
- Oct 5, 2023Cloudflare workers is adopting Ada URL parser2 points
On Stack Overflow · 1
- Oct 1, 2024How to user KV in cloudflare workers?1 vote
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 32,671 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository84 other files it gives its agents.
- AGENTS.mdAGENTS.md
- build/AGENTS.mdAGENTS.md
- src/bench/streams/AGENTS.mdAGENTS.md
- src/bench/streams/body/AGENTS.mdAGENTS.md
- src/bench/streams/compression/AGENTS.mdAGENTS.md
- src/bench/streams/digest/AGENTS.mdAGENTS.md
- src/bench/streams/encoding/AGENTS.mdAGENTS.md
- src/bench/streams/identity/AGENTS.mdAGENTS.md
- src/bench/streams/piping/AGENTS.mdAGENTS.md
- src/bench/streams/readable/AGENTS.mdAGENTS.md
- src/bench/streams/readable-byte/AGENTS.mdAGENTS.md
- src/bench/streams/strategies/AGENTS.mdAGENTS.md
- src/bench/streams/transform/AGENTS.mdAGENTS.md
- src/bench/streams/writable/AGENTS.mdAGENTS.md
- src/cloudflare/AGENTS.mdAGENTS.md
- src/node/AGENTS.mdAGENTS.md
- src/per_isolate/AGENTS.mdAGENTS.md
- src/per_isolate/crypto/AGENTS.mdAGENTS.md
- src/per_isolate/events/AGENTS.mdAGENTS.md
- src/per_isolate/url/AGENTS.mdAGENTS.md
- src/per_isolate/urlpattern/AGENTS.mdAGENTS.md
- src/per_isolate/webfs/AGENTS.mdAGENTS.md
- src/per_isolate/webstreams/AGENTS.mdAGENTS.md
- src/pyodide/AGENTS.mdAGENTS.md
- src/rust/AGENTS.mdAGENTS.md
- src/rust/cxx/AGENTS.mdAGENTS.md
- src/tests/events/AGENTS.mdAGENTS.md
- src/tests/events/eventsource/AGENTS.mdAGENTS.md
- src/tests/events/messagechannel/AGENTS.mdAGENTS.md
- src/tests/node/AGENTS.mdAGENTS.md
- src/tests/node/http-client/AGENTS.mdAGENTS.md
- src/tests/node/http-server/AGENTS.mdAGENTS.md
- src/tests/node/net/AGENTS.mdAGENTS.md
- src/tests/node/stream/AGENTS.mdAGENTS.md
- src/tests/streams/AGENTS.mdAGENTS.md
- src/tests/streams/cache/AGENTS.mdAGENTS.md
- src/tests/streams/compression/AGENTS.mdAGENTS.md
- src/tests/streams/digest/AGENTS.mdAGENTS.md
- src/tests/streams/encoding/AGENTS.mdAGENTS.md
- src/tests/streams/formdata/AGENTS.mdAGENTS.md
- src/tests/streams/htmlrewriter/AGENTS.mdAGENTS.md
- src/tests/streams/identity/AGENTS.mdAGENTS.md
- src/tests/streams/inspect/AGENTS.mdAGENTS.md
- src/tests/streams/iocontext/AGENTS.mdAGENTS.md
- src/tests/streams/piping/AGENTS.mdAGENTS.md
- src/tests/streams/r2-patterns/AGENTS.mdAGENTS.md
- src/tests/streams/readable/AGENTS.mdAGENTS.md
- src/tests/streams/readable-byte/AGENTS.mdAGENTS.md
- src/tests/streams/scaling/AGENTS.mdAGENTS.md
- src/tests/streams/sockets/AGENTS.mdAGENTS.md
- src/tests/streams/strategies/AGENTS.mdAGENTS.md
- src/tests/streams/transform/AGENTS.mdAGENTS.md
- src/tests/streams/writable/AGENTS.mdAGENTS.md
- src/tests/url/AGENTS.mdAGENTS.md
- src/tests/urlpattern/AGENTS.mdAGENTS.md
- src/workerd/api/AGENTS.mdAGENTS.md
- src/workerd/api/crypto/AGENTS.mdAGENTS.md
- src/workerd/api/node/AGENTS.mdAGENTS.md
- src/workerd/api/streams/AGENTS.mdAGENTS.md
- src/workerd/io/AGENTS.mdAGENTS.md
- The first 60 shown.
The file
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 40
Stack: every instance has one, its header Name: message and its first frame the code that constructed it.
≈ “Common” is an estimate: at least 1 in 5 of the 41,581 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
DOMException
An informal specification of DOMException as implemented in workerd, kept
in lockstep with the test suite in this directory. The tests are the
normative artifact. The cells run the same modules
(dom-exception-modules.capnp):
| Cell | Implementation | Flags the suite branches on |
dom-exception-cpp | jsg/dom-exception.{h,c++} | set_tostring_tag, enhanced_error_serialization |
dom-exception-legacy-flags-cpp | the same | do_not_set_tostring_tag, legacy_error_serialization |
dom-exception-opt-in-cpp | the same, with the dateless WebIDL opt-ins | as dom-exception-cpp, plus spec_compliant_property_attributes, immutable_api_prototypes |
dom-exception-ts, dom-exception-legacy-flags-ts, dom-exception-opt-in-ts | src/per_isolate/dom-exception.ts, under the TS_DOM_EXCEPTION autogate | as the C++ cell of the same name |
which-impl.js reads the flags; a cell's USING_TS_IMPL binding says which
implementation it means to run. The C++ cells have no @all-autogates
variant, since enabling every autogate enables TS_DOM_EXCEPTION. Every
cell needs --experimental, for
service_binding_extra_handlers (crafted payloads through
Fetcher.queue()), enable_web_file_system and enable_abortsignal_rpc.
What JavaScript cannot see is pinned in C++: the bytes a DOMException
serializes to, what reading tags 7 and 8 creates, the kj::Exception it
tunnels as and reportError()'s description, and the bytes the TypeScript
implementation's QuotaExceededError serializes to and what reading them does
with either implementation, in api/dom-exception-bootstrap-test.c++, which
runs with the per-isolate bootstrap; its @all-autogates variant runs them
against the TypeScript implementation.
Core semantics
- Construction:
new DOMException(message = '', name = 'Error'); both arguments are converted to strings, the message first, and the second is a name, never an options bag.codeis the legacy code of the name, or 0. Calling withoutnewthrowsTypeError. - Errorness:
instanceof Error; the prototype inherits fromError.prototype;String(e)isName: message(Namealone for an empty message). Attributes are read-only, but own properties defined on an instance shadow them. - Stack: every instance has one, its header
Name: messageand its first frame the code that constructed it;Error.prepareStackTraceandError.captureStackTraceapply. - Native instances: tunneled JSG errors, the serializer's
DataCloneError, the default abort and timeout reasons (which also carryretryable: true) and the file system's errors are instances of the globalDOMException, shaped as constructed ones. - Serialization: name, message and stack (tag 8). Subclass instances come
back as
DOMException, but for QuotaExceededError's (ledger #14); other own properties, and ownnameormessageproperties shadowing the attributes, are not serialized. Tags 7 and 8 read back asDOMExceptions. - Crossing workers: thrown from a fetch handler (tunneled through its
kj::Exception) or over RPC, it arrives as aDOMExceptionwith its name and message andremote: true; returned over RPC, likewise, with RPC's disposer.
Ledger
Where the TypeScript implementation differs from the C++, always toward
WebIDL. Each row is pinned on both sides with a usingTsImpl branch.
| # | Area | C++ | TypeScript | Test |
| 1 | name, message, code | own enumerable read-only data properties of each instance | prototype accessors: JSON.stringify() gives {}, Object.keys() [], delete has no effect | api-surface.js, enumeration.js, errors.js |
| 2 | stack | own enumerable accessor; deserialized, an own enumerable data property | V8's own non-enumerable accessor; deserialized, non-enumerable | api-surface.js, stack.js, serialization.js |
| 3 | Error.isError() | false | true: V8 asks the embedder about an API wrapper object (IsolateBase::isJsApiWrapperNativeErrorCallback()) | errors.js |
| 4 | util.inspect() | JSG's rendering of the own properties | an error's, as Node renders its DOMException; the prototype as an object whose getters are not called | inspect.js |
| 5 | Prototype symbols | JSG's cloudflare:internal-class and kResourceTypeInspect | cloudflare:internal-class only | api-surface.js |
| 6 | Attributes of something not a DOMException (Object.create(DOMException.prototype), String(DOMException.prototype)) | Error.prototype's | TypeError | errors.js |
| 7 | Legacy code constants | configurable, unless spec_compliant_property_attributes | not configurable | api-surface.js |
| 8 | Lone surrogates in the arguments | U+FFFD per byte of their WTF-8 | kept | construction.js |
| 9 | Stack of a subclass instance | includes the subclass constructor's frame | omits it, as for subclasses of Error | stack.js |
| 10 | Constructor's prototype | writable, unless immutable_api_prototypes | not writable | api-surface.js |
| 11 | Symbol.toStringTag | writable | not writable | api-surface.js |
| 12 | Calling without new | JSG's TypeError message | the language's | construction.js |
| 13 | code of DOMStringSizeError, NoDataAllowedError, ValidationError | 2, 6, 16 | 0: WebIDL's table of names has none of them, though their constants remain | construction.js |
| 14 | QuotaExceededError (WebIDL section 2.8.3) | none; reading a serialized one throws DataCloneError | WebIDL's subclass, with quota and requested. It serializes as a class implemented in JavaScript (tag 23, as dom-exception:QuotaExceededError), with its message, stack and amounts, and so does a subclass's instance. Thrown across workers, it tunnels as a DOMException named QuotaExceededError | quota-exceeded-error.js |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

