On 11/1/13 3:10 PM, David Bruant wrote:
Why so?

     function f(e){}

     (function(){
         var iframe = document.getElementByTagName('iframe')[0];
         iframe.addEventListener('someEvent', f);
     })()

This is very fragile. It assumes that nowhere up the scopes that f is closing over is there anyone holding a reference to that iframe object.

Simple to guarantee in simple cases, but ... fragile.

-Boris
_______________________________________________
dev-tech-js-engine-internals mailing list
dev-tech-js-engine-internals@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals

Reply via email to