Subj : outer visibility of nested functions To : netscape.public.mozilla.jseng From : =?ISO-8859-1?Q?Georg_Maa=DF?= Date : Sat Jan 10 2004 04:54 pm js> function A() { function B() { print(this.name); } B.name = 'B'; } js> A.name='A'; A js> this.name='global'; global js> A.B(); A js> Why is B a property of A? Shouldn't there be a private scope of A containing B? The expected behaviour of "A.B();" is: js> A.B(); 11: TypeError: A.B is not a function But what I get is: js> A.B(); A -- Georg Maaß - bioshop.de D-76227 Karlsruhe, Westmarkstraße 82 HTML, XML / JavaScript, C++, Java, PHP, VB / CGI, JSP, ASP, ASP.net - The ultimate DHTML engine: http://gml-modul.sourceforge.net - http://sourceforge.net/projects/gml-modul .