Subj : Re: [SpiderMonkey] Serializing JSObject To : Brian Barnes From : Brendan Eich Date : Wed Jun 23 2004 02:04 pm Brian Barnes wrote: > Question one: What is JSTYPE_LIMIT? Just the array index limit (do not equal or exceed), useful for dimensioning a C array that is indexed by actual JSType values. > Question two: Why does JSTYPE's have JSTYPE_NUMBER, but in reality it's > either a DOUBLE or an INT (easy enough to figure out.) Nothing else > drills down like that. Just wondering. This API corresponds to the typeof operator in the language, which does not distinguish between double and int (that distinction is an implementation detail, from the language user and spec points of view). Since you are dealing with an implementation of the language here, namely SpiderMonkey, you might rather use JSVAL_IS_INT, JSVAL_IS_DOUBLE, etc., than JS_TypeOfValue. > I'll post up the code (in case it's useful to anybody, it would be quite > easy to modify it to save objects and recurse through them.) Might be > something useful for core. Generally, serialization is domain-specific. Did you look at the XDR stuff? /be .