agentleFS
CloudflareKnown publishercloudflare/workerd/src/tests/dom-exception/AGENTS.md

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

Dec 2025: 0 mentionsJan 2026: 3 mentionsFeb 2026: 0 mentionsMar 2026: 2 mentionsApr 2026: 3 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 4 mentionsSep 2026: 4 mentionsOct 2026: 4 mentionsNov 2026: 3 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the cloudflare/workerd repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about cloudflare/workerd

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

27 more on GitHub

On Hacker News · 2

On Stack Overflow · 1

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
  1. Very specific:

    Stack: every instance has one, its header Name: message and its first frame the code that constructed it.

    line 40

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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):

CellImplementationFlags the suite branches on
dom-exception-cppjsg/dom-exception.{h,c++}set_tostring_tag, enhanced_error_serialization
dom-exception-legacy-flags-cppthe samedo_not_set_tostring_tag, legacy_error_serialization
dom-exception-opt-in-cppthe same, with the dateless WebIDL opt-insas dom-exception-cpp, plus spec_compliant_property_attributes, immutable_api_prototypes
dom-exception-ts, dom-exception-legacy-flags-ts, dom-exception-opt-in-tssrc/per_isolate/dom-exception.ts, under the TS_DOM_EXCEPTION autogateas 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. code is the legacy code of the name, or 0. Calling without new throws TypeError.
  • Errorness: instanceof Error; the prototype inherits from Error.prototype; String(e) is Name: message (Name alone 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: message and its first frame the code that constructed it; Error.prepareStackTrace and Error.captureStackTrace apply.
  • Native instances: tunneled JSG errors, the serializer's DataCloneError, the default abort and timeout reasons (which also carry retryable: true) and the file system's errors are instances of the global DOMException, 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 own name or message properties shadowing the attributes, are not serialized. Tags 7 and 8 read back as DOMExceptions.
  • Crossing workers: thrown from a fetch handler (tunneled through its kj::Exception) or over RPC, it arrives as a DOMException with its name and message and remote: 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.

#AreaC++TypeScriptTest
1name, message, codeown enumerable read-only data properties of each instanceprototype accessors: JSON.stringify() gives {}, Object.keys() [], delete has no effectapi-surface.js, enumeration.js, errors.js
2stackown enumerable accessor; deserialized, an own enumerable data propertyV8's own non-enumerable accessor; deserialized, non-enumerableapi-surface.js, stack.js, serialization.js
3Error.isError()falsetrue: V8 asks the embedder about an API wrapper object (IsolateBase::isJsApiWrapperNativeErrorCallback())errors.js
4util.inspect()JSG's rendering of the own propertiesan error's, as Node renders its DOMException; the prototype as an object whose getters are not calledinspect.js
5Prototype symbolsJSG's cloudflare:internal-class and kResourceTypeInspectcloudflare:internal-class onlyapi-surface.js
6Attributes of something not a DOMException (Object.create(DOMException.prototype), String(DOMException.prototype))Error.prototype'sTypeErrorerrors.js
7Legacy code constantsconfigurable, unless spec_compliant_property_attributesnot configurableapi-surface.js
8Lone surrogates in the argumentsU+FFFD per byte of their WTF-8keptconstruction.js
9Stack of a subclass instanceincludes the subclass constructor's frameomits it, as for subclasses of Errorstack.js
10Constructor's prototypewritable, unless immutable_api_prototypesnot writableapi-surface.js
11Symbol.toStringTagwritablenot writableapi-surface.js
12Calling without newJSG's TypeError messagethe language'sconstruction.js
13code of DOMStringSizeError, NoDataAllowedError, ValidationError2, 6, 160: WebIDL's table of names has none of them, though their constants remainconstruction.js
14QuotaExceededError (WebIDL section 2.8.3)none; reading a serialized one throws DataCloneErrorWebIDL'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 QuotaExceededErrorquota-exceeded-error.js

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.