From 3ba3a82432076ab10fdb2af5d3c4a388562286ea Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Tue, 13 Oct 2026 19:59:15 +0200 Subject: [PATCH] =?UTF-8?q?Answer=20CodeRabbit's=20review:=200=20?= =?UTF-8?q?=F0=9F=94=B4,=201=20=F0=9F=9F=A1;=20only=20a=20catchable=20out-?= =?UTF-8?q?of-memory=20throw=20is=20engine-limit,=20and=20isolation=20from?= =?UTF-8?q?=20heap=20exhaustion=20takes=20a=20separate=20process,=20not=20?= =?UTF-8?q?a=20worker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 4 ++-- MIGRATION.md | 2 +- README.md | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed289be..221268b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,8 +10,8 @@ - **Breaking:** the markdown readers refuse a value that is not a string with the new code `not-a-string`; `MIGRATION.md` lists what each value did before. - **Breaking:** every call returns the new code `engine-limit` where a conversion passes the - JavaScript engine's longest array, `Map` or `Set`, or runs it out of memory, and, on - JavaScriptCore, its longest string. A retry may succeed. Every other refusal stays deterministic. + JavaScript engine's longest array, `Map` or `Set`, or meets an out-of-memory throw the call can + catch, and, on JavaScriptCore, its longest string. A retry may succeed. Every other refusal stays deterministic. - **Breaking:** an attribute value that is not a plain object, array or JSON primitive, such as a `Date`, `Map`, typed array or class instance, makes `isAdfDocument` return `false` and the converters refuse it as `not-an-adf-document`. Before, the converters wrote it as `{}` or its own diff --git a/MIGRATION.md b/MIGRATION.md index 4ddb0e2..328addd 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -114,4 +114,4 @@ the parser refused with one of the four now reads, or refuses with the code the | `null`, `undefined` or a non-empty array, on parse | throws a `TypeError` | `not-a-string` | | a `String` object, on parse | the document its text spells | `not-a-string`; pass `String(value)` | | any other value that is not a string, such as a number or `{}`, on parse | an empty document | `not-a-string` | -| a conversion past the JavaScript engine's longest array, `Map` or `Set`, or that the engine reports as out of memory, and on JavaScriptCore one past its longest string | throws | `engine-limit`; retry it once | +| a conversion past the JavaScript engine's longest array, `Map` or `Set`, or meeting an out-of-memory throw the call can catch, and on JavaScriptCore one past its longest string | throws | `engine-limit`; retry it once | diff --git a/README.md b/README.md index fb3e17d..32a4797 100644 --- a/README.md +++ b/README.md @@ -412,10 +412,10 @@ typed on `ConvertError` takes both. A call reports the first refusal in document order and stops, so a document with several surfaces them one per call. Every refusal but `engine-limit` is deterministic — there is no I/O anywhere — so a retry returns the identical error: fix the input, or set the document aside. `engine-limit` -can mean memory ran short: retry it once, and treat a repeat as lasting. On V8 (Node, Deno, -Chrome), running out of JavaScript heap ends the process. In Node, convert input of unbounded size -in a `worker_threads` worker given `resourceLimits`: running out of heap there ends only that -worker. +can mean memory ran short: retry it once, and treat a repeat as lasting. Only an out-of-memory +throw the call can catch becomes `engine-limit`: on V8 (Node, Deno, Chrome), running out of +JavaScript heap ends the process. Convert input of unbounded size in a separate process with its +own memory limit where that must not take yours down. ### Parsing