Subj : Re: Namespaces To : netscape.public.mozilla.jseng From : Peter Paulus Date : Tue Oct 11 2005 04:08 pm Berserker wrote: > How can I implement namespaces in spidermonkey? > I need to have a sintax like this: > > var file = new core.io.File(); > > Thanks > > As far as I understand it, javascript 1.5 (or ECMA3) has no concept namespace. What you could do to partition names into (quasi) packages is decorate the classname with a package identifier: w3cDOM_Document InDesign_Document I believe this approach is also advised by ECMA in ECMA-290 (paragraph 5.2 ECMAScript Object Implementation) 'However, to prevent name space collisions, the component constructor should follow the hierarchical convention of domainName_subdomainName_category1_...categoryN_componentName or category1_...categoryn_componentName.' Hope this helps Peter Paulus .