MCPcopy Create free account
hub / github.com/BridgeAR/safe-stable-stringify / toString

Function toString

test.js:2070–2070  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2068
2069 // eslint-disable-next-line
2070 const obj = { b: 2, c: { a: true, toJSON () { throw { toString() { throw new Error('Yikes') } } } }, a: 1 }
2071 const expected = '{\n "a": 1,\n "b": 2,\n "c": "Error: Stringification failed with toJSON (Failed)"\n}'
2072 const actual = serializer(obj, null, 1)
2073 assert.equal(actual, expected)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected