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;
}
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
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
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 =
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
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
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
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