Hi,

I have an overlay-type class that has fluent interface (http://
en.wikipedia.org/wiki/Fluent_interface):

  private static class JsMap extends JavaScriptObject {
    public static final native JsMap create() /*-{ return {} }-*/;

    protected JsMap() {}

    public native final JsMap put(String key, String value) /*-{ this
[key] = value; return this; }-*/;
  }

I create an instance of JsMap:

    JsMap map = JsMap.create()
                                  .put("a", "A")
                                  .put("b", "B");

I expected resulting map to be {'a': 'A', 'b': 'B' }, but instead I
got: { 'b', 'B' }.

This is what it looks like when I compiled to JavaScript in PRETTY
mode:
     map = $put(({}['a'] = 'A' , {}), 'b', 'B');
     function $put(this$static, key, value){
            this$static[key] = value;
            return this$static;
    }

This looks like a bug in the GWT Compiler.

--

You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


Reply via email to