Summary: Add functionality to decode a JSON string into an object.
Rename JX.JSON.serialize to stringify to match the ES5 method name. Both
will use their native counterparts if available. They are not spec
compliant, ie. they do not support replacer/receiver j0nx. Cleaned up
some of the stringify code. JX.JSON.parse is intended to never throw, it
will return the parsed object or null. The idea is that if it would
throw in dev but you rely on it to return null to check if the data
contained a value, you would have to cover both the exception and the
null check in your application code.
Test Plan: verify that both methods can properly decode and encode JSON
Reviewers: tomo, epriestley, mroch
Differential Revision: 510
Summary: If no third argument is provided, this method will behave
differently depending on whether the element has the class or not.
Javelin discourages state management through className. Throwing an
error in DEV can help developers spot this mistakte.
Test Plan: Test that it throws in DEV if anything but true or false are
provided as third argument.
Reviewers: mroch, epriestley, tomo
Differential Revision: 511