incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Heidegger ...@leichtgewicht.at>
Subject Re: JavaScript VS. Weak references
Date Tue, 07 Feb 2012 20:22:53 GMT
On 08/02/2012 05:14, Maciek Sakrejda wrote:
> Weak references are on the horizon for JS:
> http://wiki.ecmascript.org/doku.php?id=harmony:weak_maps#weakmap
Yeah, its funny how such a language construct actually is implemented in 
Firefox without the world knowing. Chrome/Opera and IE have nothing alike.
However: It will not become standard before the release of IE10 and 
therefore will take - estimate at least more 5 years
until it can be safely used in the JavaScript context - rough estimate.

> Not all listeners have to be weak references.
class MyButton extends Sprite {
    public function MyButton() {
      addEventListener(MouseEvent.MOUSE_OVER, handleMouseOver);
    }
}

This is a very simple and common case of a event that is not possible to 
be fixed without weak listeners.

yours
Martin.

Mime
View raw message