3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 14:45:44 +01:00

Answer architecture round 1: the guard refuses only the measured overflow errors, the README keeps such a document read-only, and items 106 and 107 take the heap and the carry's indentation

This commit is contained in:
2026-10-11 20:40:21 +02:00
committed by Lillem4n
parent 4b3bce8d02
commit fdf7f1c2b7
6 changed files with 42 additions and 7 deletions
+6 -1
View File
@@ -32,7 +32,7 @@ test('every ConvertErrorCode is the code of a production call site, and every ca
assert.deepEqual(calledCodes(), declaredCodes())
})
test('refuses where SpiderMonkey runs out of string, and lets any other throw through', () => {
test('refuses where SpiderMonkey runs out of string, and lets a stack overflow or any other throw through', () => {
const overflow = new Error('allocation size overflow')
overflow.name = 'InternalError'
assert.deepEqual(
@@ -41,6 +41,11 @@ test('refuses where SpiderMonkey runs out of string, and lets any other throw th
}),
{ error: { code: 'unsupported-node-shape', message: 'the output runs past what this JavaScript engine holds: allocation size overflow', path: [] }, ok: false },
)
assert.throws(() =>
withinEngineLimits(() => {
throw new RangeError('Maximum call stack size exceeded')
}),
)
assert.throws(() =>
withinEngineLimits(() => {
throw new TypeError('a bug')