(value)
| 527 | /** @type {ObjectSerializerContext<EXPECTED_ANY>} */ |
| 528 | let ctx = { |
| 529 | write(value) { |
| 530 | try { |
| 531 | process(/** @type {ComplexSerializableType} */ (value)); |
| 532 | } catch (err) { |
| 533 | if (err !== NOT_SERIALIZABLE) { |
| 534 | if (hasDebugInfoAttached === undefined) { |
| 535 | hasDebugInfoAttached = new WeakSet(); |
| 536 | } |
| 537 | if (!hasDebugInfoAttached.has(/** @type {Error} */ (err))) { |
| 538 | /** @type {Error} */ |
| 539 | (err).message += |
| 540 | `\nwhile serializing ${stackToString(/** @type {ComplexSerializableType} */ (value))}`; |
| 541 | hasDebugInfoAttached.add(/** @type {Error} */ (err)); |
| 542 | } |
| 543 | } |
| 544 | throw err; |
| 545 | } |
| 546 | return ctx; |
| 547 | }, |
| 548 | setCircularReference(ref) { |
| 549 | addReferenceable(ref); |
| 550 | }, |
no test coverage detected