mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-12 11:48:29 +01:00
Answer auto-reviewer round 1: the README says to retry the engine-limit refusal once on JavaScriptCore, and the merged-text test says why it stays cheap
This commit is contained in:
@@ -410,7 +410,8 @@ 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 is deterministic on one engine — there is no I/O anywhere — so a
|
||||
retry returns the identical error: fix the input, or set the document aside. Only the engine-limit
|
||||
refusal under `unsupported-node-shape` differs between engines.
|
||||
refusal under `unsupported-node-shape` differs between engines; on JavaScriptCore (Bun, Safari),
|
||||
retry it once, since that engine reports a heap running short the same way.
|
||||
|
||||
### Parsing
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ test('refuses what the document guard refuses, and nothing else', () => {
|
||||
assert.match(portableDocument(document(paragraph(deepInline))), /^unsupported-nesting-depth at /)
|
||||
})
|
||||
|
||||
// The merge throws at its concatenation, before any text is scanned, so no engine holds more than the one string.
|
||||
test('refuses a paragraph whose merged text passes the engine\'s longest string', () => {
|
||||
const long = 'a'.repeat(2 ** 28)
|
||||
const merged = paragraph(...Array.from({ length: 9 }, () => text(long)))
|
||||
|
||||
Reference in New Issue
Block a user