MaskingTechnology / jitar

Distributed runtime for JavaScript and TypeScript
https://jitar.dev
MIT License
121 stars 9 forks source link

'undefined' becomes 'null' after deserialization #500

Closed petermasking closed 3 months ago

petermasking commented 3 months ago

This behavior is found when (de)serializing a class object. In this specific case, undefined values are getting replaced with null values in the constructor arguments. We need to figure out the cause and the range of this issue.

basmasking commented 3 months ago

The issue here is that the value of undefined, when included in an array, is changed into null. This is done to presevere the length of the array by the stringify method.

To overcome this issue, we need to take a slightly different approach and cannot simply use the existing array serialization.