3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-13 04:08:29 +01:00

Answer prose round 2: item 77 says the reader, not the copy, reads arrays by index

This commit is contained in:
2026-10-04 23:47:13 +02:00
committed by Lillem4n
parent d803f18f6e
commit 4b23ec90d0
+5 -5
View File
@@ -116,11 +116,11 @@ and the conversions read the caller's object many times, so a throwing getter, a
getter minting a fresh child per access throws or walks forever. Item 45's reader copies the
document once inside one tight `try/catch`, reading property descriptors so no getter runs: an
accessor property, or a Proxy trap that throws, is `not-an-adf-document`. The copy keeps own
enumerable keys, as `JSON.stringify` does, so an inherited or non-enumerable key drops, and it reads
arrays by index, so no custom iterator runs. Every later step works on the copy. A Proxy can still
claim unbounded width, which the 500-level limit does not cover, so the copy needs a cap on the
values it reads. No standard sets that number: the chunk asks the maintainer for it first. Found by
the technical-principles audit, 2026-10-04.
enumerable keys, as `JSON.stringify` does, so an inherited or non-enumerable key drops. The reader
reads arrays by index, so no custom iterator runs. Every later step works on the copy. A Proxy can
still claim unbounded width, which the 500-level limit does not cover, so the copy needs a cap on
the values it reads. No standard sets that number: the chunk asks the maintainer for it first. Found
by the technical-principles audit, 2026-10-04.
### 66. Refuse an attribute value that is not a plain object, array or JSON primitive.