Calling toJSON outside the context of a JSON.stringify doesn't recursive call toJSON on all the properties, so trying to create serializable objects from the NPC class fails if there are results or result sets in the field values.
defaultToJSON probably needs to check for "toJSON" method on any objects and call it if it's there.
Calling toJSON outside the context of a JSON.stringify doesn't recursive call toJSON on all the properties, so trying to create serializable objects from the NPC class fails if there are results or result sets in the field values.
defaultToJSON
probably needs to check for "toJSON" method on any objects and call it if it's there.