douglascrockford/JSON-js — Issue #28: Incorrect results if `Date#toJSON` is specified but not the `JSON` object.
Author: jdalton
Created: 2012-01-30 19:10:04+00:00
State: open

I noticed that if I include `json2.js` on a page that doesn't have the `JSON` object but does have `Date#toJSON` specified I get incorrect output from `JSON.stringify()`.

Here is a simple example:

~~~ js
JSON.stringify(Object('hi')); // should return '"hi"' but returns '{"0":"h","1":"i"}'
~~~