...you need a feature called selector namespaces. Dave Simmons' Smallscript language has had them for a few years, but it's being added to the new Javascript 2.0 standard as well. You can find Waldemar Horwat's LL1 presentation on it at:
[link|http://ll1.mit.edu/horwat.ppt|[link|http://ll1.mit.edu/horwat.ppt|http://ll1.mit.edu/horwat.ppt]]
Here's the rationale from the JS 2.0 spec:
[link|http://www.mozilla.org/js/language/js20/rationale/versioning.html|[link|http://www.mozilla.org/js/language/js20/rationale/versioning.html|http://www.mozilla....sioning.html]]
Incidentally, I met Waldemar Horwat, and discovered how he is managing the Javascript standardization effort. He wrote a formal semantics for JS, and then wrote a program that uses the semantics as an interpreter. Then, whenever someone requests a new feature, he adds it and reports the problems and inconsistencies it causes. Apparently this quells a lot of the bogus feature-creep pressure. This is the most cynically pragmatic use of formal methods I've ever seen, and is IMO totally brilliant. :) (He also automatically generates the standard from the formal semantics, too!)
I think Javascript 2.0 stands a very good chance of becoming a language I can actually respect -- the people designing it are doing an excellent job so far. It's more complex than I like, but still remarkably clean.