In some places, we rely on the toString behavior of objects passed as attrs. Check first for the function and if it's not defined, call JSON.stringify. This will break for inheritance hierarchies where toString is defined one or more levels above the instance but should work for our use cases.
decided to not add any magic for this and keep the contract simple: if you pass us an object, we'll JSON stringify it. if you want to do any other serialization, do it before you pass the string.
In some places, we rely on the toString behavior of objects passed as attrs. Check first for the function and if it's not defined, call JSON.stringify. This will break for inheritance hierarchies where toString is defined one or more levels above the instance but should work for our use cases.