[Project_owners] JS behavior in FF 1.5
vnagarjuna at gmail.com
Fri Dec 9 15:30:20 EST 2005
Thanks a lot for your responses. I understand why this is needed but
adding a space or some other special character in front leaves me with
a bad taste in my mouth.
On 12/8/05, Aaron Boodman <zboogs at gmail.com> wrote:
> Wladimir is right of course. Sorry bout that.
> - a
> On 12/8/05, Wladimir Palant <trev at gtchat.de> wrote:
> > On 12/9/05, Aaron Boodman <zboogs at gmail.com> wrote:
> > > > 2. How should I use associative arrays if unexpected values like this
> > > > are returned?
> > >
> > > Don't use arrays as associative arrays. They didn't work before,
> > > either. For example "length" would have shown up in 1.0.7. Use objects
> > > as associative arrays, that's what they're there for.
> > This helps but not a lot. Objects still have predefined properties
> > like 'watch' or 'eval'. If you want to avoid collisions, you have to
> > add a space before the key name:
> > var assoc = new Object();
> > var key = 'watch';
> > alert(assoc[' ' + key]);
> > key = 'map';
> > assoc[' ' + key] = 'value';
> > regards,
> > Wladimir
> Project_owners mailing list
> Project_owners at mozdev.org
More information about the Project_owners