codeflash/packages
ali 0641930f25
fix: use cross-context type detection in V8 serializer self-test
The V8 serialization self-test used `instanceof Map` which fails in
Jest's sandboxed VM context where the Map class from v8.deserialize
differs from the test environment's Map class. This incorrectly
disabled V8 serialization, falling through to msgpack which often
also isn't resolvable in monorepo setups.

Replaced all `instanceof` checks in the serializer with
`Object.prototype.toString.call()` for cross-VM-context compatibility,
matching the pattern already used in the msgpack codepath.

Trace IDs: 003e1410, fe2ae122, fde51112 (153 affected logs)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 18:47:38 +02:00
..
codeflash fix: use cross-context type detection in V8 serializer self-test 2026-03-25 18:47:38 +02:00