Subj : (Spidermonkey) Converting a property name to a tinyId To : netscape.public.mozilla.jseng From : zakalawe@mac.com (James Turner) Date : Tue Mar 11 2003 03:42 pm I have a pressing need to map a string which *might* be the name of property I've defined on an object to it's numerical ID. Essentially I need a function which returns either a failure or the value I passed in via the JSPropertySpec to JS_InitClass. Essential I want: int8 tinyid; JSBool hasTinyId = JS_GetPropertyTinyId(ctx, obj, "foo", &tinyid); to return true, and set tinyid to be (say) 42, assuming the JSPropertySpec looked like { "foo", 42, ... flags .... }, I've looked through the jsobj.c code but am getting lost rather easily, so could someone tell me if this is even possible? I could maintain a seperate lookup table by hand by copying the JSPropertySpec array I pass to JS_InitClass, but I figure that table has *got* to exist somewhere internally. Many thanks, James .