[thelist] Proper Way of Separating 'Library' Files in JS

Andrew Clover and-evolt at doxdesk.com
Sat Jun 18 09:16:47 CDT 2005


Matt Warden <mwarden at gmail.com> wrote:

> Essentially, I am prepending a string to all hash keys to ensure there
> are no collisions with member properties.

Ah! Fair enough then. I was having horrible visions of Array lists and 
low-level hashgen code written in JS. :-)

(Incidentally, using numbers as keys can go horribly wrong too, 
depending on browser. Opera for one mysteriously turns numbers over a 
certain threshold - much lower than the int/double threshold - with 
completely arbitrary other numbers. B'zarre.)

> It's probably the most annoying thing about Javascript, in my opinion.

Oh, don't get me started!

> Whats worse is when people try to use the Array class as an
> associative array / hashtable and start getting keys like 'length'
> that are really member properties.

Yeah, makes for...in much less useful than it should be. And I'm not 
especially liking Mozilla's hacks to get around this stuff and provide 
getters/setters and stuff much either.

-- 
Andrew Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/


More information about the thelist mailing list