On 12/9/05, Aaron Boodman <[EMAIL PROTECTED]> 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
[email protected]
http://mozdev.org/mailman/listinfo/project_owners

Reply via email to