toJSONString and other introspections

Kris Zyp kriszyp at xucia.com
Mon Jun 25 09:06:03 PDT 2007


I was wondering how toJSONString should handle objects with members of
multiple namespaces?
For example:
namespace N1
obj = {};
obj.public::a=1
obj.N1::b=2
obj.toJSONString() -> ?
Would toJSONString simply not be able to serialize in such a way that the
object can deserialized? The reference implementation does not seem to have
toJSONString implemented yet. Doing an enumeration of obj returns gives an
"a" and an empty string for keys, I assume that is not correct and that
would not be the field names used by toJSONString.
Also, Is there specific way that toJSONString should behave when called for
a
class? Will it just perform a normal enumeration (i.e. not override the
default toJSONString)?
Also, is there a way to determine what the class object is for a given
object? In the reference implementation, the toString() will tell you name
of the class, but is there a way to access to the class object (like
getClass() in Java) from an instance object? Also, should there be any
introspection available on a
class object (beside the static members), such as the determining member
attributes?
Thanks,
Kris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20070625/39df7ec5/attachment-0002.html 


More information about the Es4-discuss mailing list