diff --git a/test/parallel/test-error-serdes.js b/test/parallel/test-error-serdes.js index f01dc0d6a8a81d..a65781c25eb261 100644 --- a/test/parallel/test-error-serdes.js +++ b/test/parallel/test-error-serdes.js @@ -49,3 +49,20 @@ assert.strictEqual(cycle(Function), '[Function: Function]'); assert.strictEqual(err.name, 'TypeError'); assert.strictEqual(err.code, 'ERR_INVALID_ARG_TYPE'); } + +{ + let called = false; + class DynamicError extends Error { + get type() { + called = true; + return 'dynamic'; + } + + get shouldIgnoreError() { + throw new Error(); + } + } + + serializeError(new DynamicError()); + assert.deepStrictEqual(called, true); +}