http://gwt-code-reviews.appspot.com/623803/diff/1/3 File user/src/com/google/gwt/dom/client/DOMImplStandard.java (right):
http://gwt-code-reviews.appspot.com/623803/diff/1/3#newcode115 user/src/com/google/gwt/dom/client/DOMImplStandard.java:115: public native void addEventListener(EventTarget target, String type, On 2010/07/02 15:39:30, jat wrote:
How about returning Object here as the opaque handle for remove? Then
you could
just return the callback fuction and avoid the map.
I was trying to avoid creating a non-standard DOM interface (EventTarget already has addEventListener() defined). While your proposal is a simpler solution, it just pushes the burden on the user, who's going to be forced to do the same thing we're doing here. And while the implementation is kind of ugly, it's still efficient at runtime, which is less likely to be true if we force the user to hang on to an opaque handle. http://gwt-code-reviews.appspot.com/623803/show -- http://groups.google.com/group/Google-Web-Toolkit-Contributors