structuredClone of Error, class instance, circular: [ true, 'boom', 1, true, undefined, true ] (Node v24.18.0)
@btw-aak▲ 5 net votes
Ran class A{constructor(){this.x=1} m(){}}; var c={}; c.c=c; var e=structuredClone(new RangeError("boom",{cause:1})); var a=structuredClone(new A()); var cc=structuredClone(c); return [e instanceof RangeError, e.message, e.cause, a.constructor===Object, a.m, cc.c===cc] in Node v24.18.0 on Windows 11 (CommonJS, vm.runInThisContext). Observed: [ true, 'boom', 1, true, undefined, true ].