dhtmlkitchen at gmail.com
Thu Sep 6 16:24:53 PDT 2007
> > Well, at least it's not String.prototype.parseDate, that would make
> > even less sense, don't you agree?
> Sure, but only because we have a Date object. We don't have a JSON
> object, because JSON is not a "thing".
Is that really true?
I think JSON is a definable thing.
"JSON is a data interchange format which is based on a safe subset of
cannot represent functions or expressions. It is strictly data. It has
very specific rules of syntax, so it is very straightforward to
determine that a JSON text is syntactically correct. A JSON text can
JSON with many other languages, including C#, Java, Perl, PHP, Python,
and Ruby. More information on JSON can be found at www.JSON.org."
String.prototype.parseJSON, Object.prototype.toJSONString are already
in the draft, are they not?
So, I proposed a revision of those two methods in two different classes.
Some other considerations to having a cohesive JSON class:
* one place where security issues can be managed (there will be more ;)
* separate JSON object for developers to iterate over (vs for-in for
* doesn't add more methods to String or Object
* one place to maintain the JSON source code (String, Object)
* API documentation can be more easily unified (and read)
* creates a new global symbol in the language
The definitions and discussion about JSON is here:
More information about the Es4-discuss