Jim Grandy wrote: > > On Jun 28, 2006, at 10:15 AM, Max Carlson wrote: > >>>> I'm confused. How can this work: `this.timerList[d]` (where d is a >>>> delegate, hence an object?) >>>> >>>> >>> Hrm? It certainly does work. You can use any object as a key in >>> JavaScript, no? >>> >> >> My understanding is, the object will get coerced to a string since >> object keys must be strings. This only works if the object being used >> as a key has a toString() method that returns something unique per >> instance. >> > > Ah, interesting. I'll write a test, and expect it to fail :-) > > If that doesn't work, then perhaps I should consider storing the timer > array with the "delegate" (which, remember, doesn't have to be an > LzDelegate). I feel a little uncomfortable with the idea of adding a > slot to an arbitrary object, but it's a clean solution in this case. > Opinions?
That seems dirty. As long as LzDelegate.toString() returns a unique identifier (which it may) you should be fine. Getting a meaningful UID for each delegate is handy for debugging anyhow... -Max _______________________________________________ Laszlo-dev mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
