Subj : Re: Enumerating standard class properties & methods To : Sterling Bates From : Brendan Eich Date : Wed Dec 17 2003 11:21 am Sterling Bates wrote: > That's cool. Do you know of a way to obtain the memory address for a given > class declaration (like Date) so I can check it from outside the engine? Why do you need that? Is this related to enumerating the global object to include all [[DontEnum]] properties? If you really need to know the JSClass* for the Date class, you'll have to do something like this: JSBool ok; static const char date_proto_str[] = "Date.prototype"; jsval rval; JSClass *date_class; ok = JS_EvaluateScript(cx, global, date_proto_str, sizeof date_proto_str - 1, NULL, 0, &rval); if (!ok) fail somehow; date_class = JS_GET_CLASS(cx, JSVAL_TO_OBJECT(rval)); If you really need a Date API, there are some functions in jsdate.h that are marked JS_FRIEND_API, which means they're not frozen as solid as the JS_PUBLIC_API functions prototyped in jsapi.h -- but OTOH they haven't changed in years. If you need other class pointers or APIs, let me know. /be .