Re: [JSMentors] Re: Still confused with prototypal OO

2010-12-25 Thread Yu-Hsuan Lai
Will closure create references to every object outer even when I don't explicitly use them? example: function outer () { var div = document.createElement(div); function inner() { var a,b,c and do something blahblah without div; } outer = inner(); return inner; }

Re: [JSMentors] Re: Still confused with prototypal OO

2010-12-25 Thread Balázs Galambosi
Will closure create references to every object outer even when I don't explicitly use them? [...] In this case, I still have a memory leak? No, if you are not referencing the DOM object than there will be no circular reference so no memory leak. - Balázs 2010/12/25 Yu-Hsuan Lai

Re: [JSMentors] Re: Still confused with prototypal OO

2010-12-25 Thread Garrett Smith
On 12/25/10, Yu-Hsuan Lai rainco...@gmail.com wrote: Will closure create references to every object outer even when I don't explicitly use them? example: function outer () { var div = document.createElement(div); function inner() { var a,b,c and do something blahblah

Re: [JSMentors] Re: Still confused with prototypal OO

2010-12-25 Thread Balázs Galambosi
2010/12/25 Garrett Smith dhtmlkitc...@gmail.com: In this case, I still have a memory leak? Yes, you do. But what are you doing there? Alright. Now I'm not sure what the real code in Yu's head looks like, but when I first read I thought he meant something like: function outer() { var div =

Re: [JSMentors] Re: Still confused with prototypal OO

2010-12-25 Thread Dmitry A. Soshnikov
On 25.12.2010 2:46, fernando trasvina wrote: [...] What crockford is trying to point is that you should not think as the new operator as the classical use of new you should think of it as the prototype pattern, Yes, but actually, there is no a big difference between classical new and

Re: [JSMentors] Re: Still confused with prototypal OO

2010-12-25 Thread Garrett Smith
On 12/25/10, Balázs Galambosi galambal...@gmail.com wrote: 2010/12/25 Garrett Smith dhtmlkitc...@gmail.com: In this case, I still have a memory leak? Yes, you do. But what are you doing there? Alright. Now I'm not sure what the real code in Yu's head looks like, but when I first read I

Re: [JSMentors] Re: Still confused with prototypal OO

2010-12-25 Thread fernando trasvina
On Dec 25, 2010, at 1:51 PM, Dmitry A. Soshnikov wrote: On 25.12.2010 2:46, fernando trasvina wrote: [...] What crockford is trying to point is that you should not think as the new operator as the classical use of new you should think of it as the prototype pattern, Yes, but

[JSMentors] Javascript Unit Testing

2010-12-25 Thread Glan
Hi All, I'm interested in getting some people's thoughts on unit testing in javascript. I've been looking at qUnit, but an aware of a number other methods jsunit,jsspec, jspec etc. With qUnit in particular there are a few areas which I'm still unsure about: 1) Making tests dependent on one