Custom implementation of JSON.stringify that ignores some toJSON methods. We need to do that
because some sites badly override toJSON on certain objects. Removing all toJSON methods from
nested values would be too costly, so we just detach them from the root value, and native classes
used to build JSON values (Array and Object).
Note: this still assumes that JSON.stringify is correct.
Custom implementation of JSON.stringify that ignores some toJSON methods. We need to do that because some sites badly override toJSON on certain objects. Removing all toJSON methods from nested values would be too costly, so we just detach them from the root value, and native classes used to build JSON values (Array and Object).
Note: this still assumes that JSON.stringify is correct.