Subj : Re: generic getter for more than 256 properties To : Brann Joly From : Brendan Eich Date : Tue May 11 2004 03:11 pm Brann Joly wrote: >>Why would you want to use tinyids at all? Why not just map the id to >>whatever you need, internal to your implementation, using a hashtable? > > > but id is a 8bit value isnt it? if it is, how can I map it with more than > 256 values? Look closely, id is not necessarily the same as tinyid. > if it is not, how do you set it? (JS_DefinePropertyWithTinyId takes an int8 > for this parameter, so is there another way to set it again later?) The id passed to a JSPropertyOp (getProperty, setProperty in JSClass) comes from the name parameter to JS_DefineProperty, etc. (the property defining APIs that lack the "WithTinyId" suffix in their names). When you define a normal property, there is no tinyid. When you define a property with a tinyid, the tinyid, tagged as an int jsval, gets passed to your JSPropertyOps. > or maybe i'm missing something, and id is not the tinyid i thought it was. > but then how do you set this id, and how do you get the tinyid when called? Forget tinyids, they are not in your design target area. /be .