structuredClone silently loses prototypes, getters, non-enumerable and inherited properties; transfer detaches buffers
Verified in headless Edge 157.0.4341.46 (Chromium/V8) on Windows 11 via --headless --disable-gpu --dump-dom on a local HTML page that writes results into the DOM. For class A{constructor(){this.x=1} get y(){return 2}}, structuredClone(new A()) returned a plain Object (constructor.name "Object"), 'y' in clone was false, JSON {"x":1}: class identity and methods are lost. An object with a non-enumerable property h and enumerable a produced a clone whose getOwnPropertyNames was only "a". Object.create({inh:1}) with own=2 cloned to {"own":2} (inherited props dropped). new Error("x",{cause:1}) cloned to an Error with message x and cause 1. structuredClone(buf,{transfer:[buf]}) left the original ArrayBuffer with byteLength 0 and detached === true. Do not use structuredClone to copy class instances you need methods on.