Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
schristo
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
schristo
15y ago
One more and then I'll shut up :) It looks like my previous example was affected by eval. The following reports foo's value as undefined while breaking for the debugger statement in Firefox and Chrome: (function () { var foo = "bar"
2.
▲
by
schristo
15y ago
So to answer myself, it does look like a reference is maintained despite no direct references existing within the inner function (unless eval is causing the reference to be maintained): (function () { var foo = "bar"; return fun
3.
▲
by
schristo
15y ago
Maybe I'm missing something, but the function doesn't point to `el`. `el` just exists in a lower execution context on the stack. If a variable inside the anonymous function referenced `el` directly, then a closure would be formed over `el`.
4.
▲
by
schristo
15y ago
According to the article, the code below causes a memory leak in IE, though I fail to see how. function addHandler() { var el = document.getElementById('el'); el.onclick = function() { this.style.backgroundColor = 'red
5.
▲
by
schristo
15y ago
It will currently fall back to using plain ol' HTML img tags, but Flash and WebGL renderers are in the works.
6.
▲
Show HN: An immersive 3D interface for Facebook
(apps.facebook.com)
9 points
by
schristo
15y ago
|
3 comments