2013/10/2 laurent bernabe <laurent.bern...@gmail.com>: > Apologizes, for POO in javascript, I did not want to talk about > encapsulation, but about fields visibilty (public/protected/private). > I've read the mozilla page link that Manuel gave me, but they don't talk > about that OOP feature. > > And I know that a field declared with 'var' rather than 'this' is private, > but only visible in the function where it has been defined (commonly the > class constructor) :
False. A variable declared with 'var' is visible in the object private methods and privileged methods too. This is worth reading: http://javascript.crockford.com/private.html so it seems to me less flexible that Java approch. And > that is because I want to use a framework. > > Unfortunately, Dojo ... is heavy in size (around 3Mb). And I can't afford > relying on this weight. So, no independient modules as their homepage say? Can you show how they do OOP? -- .. manuq .. _______________________________________________ Sugar-devel mailing list Sugar-devel@lists.sugarlabs.org http://lists.sugarlabs.org/listinfo/sugar-devel