Just for the record in this thread:
For the same purpose (To not occupy property-names with foreign functionality) I support the idea of a Symbol.toJSON
.
Hey ECMA community,
I'm working on a library Boa that creates Proxy objects for binding to Python's object, but it fails on calling JSON.stringify with these proxy objects because it's circular as https://github.com/alibaba/pipcook/issues/146 .
And I just found that JSON.stringify will call the obj.toJSON() internally, so i'm wondering if a new well-known Symbol(.toJSON) instead of the current string keyed, just like what we have achieved on toPrimitive and toStringTag?
If that makes sense, I'…