Hi,
I'm trying to implement an API that uses two JavaScript reserved words
in a JSON structure: "public" and "private"
Is there a clever JS technique to work-around this use of the reserved
word "public"?
Consider the following object
{"addresses" : {"public": [],"private":[]}
The following JSNI code fails "missing name after . operator":
public final native List<String> getPublicAddress() /*-{
return this.addresses.public;
}-*/;
public final native void setPublicAddress(String nextValue) /*-{
if (this.addresses.public.length = 0) {
this.addresses.public = new Array();
}
this.addresses.public.push(nextValue);
}-*/;
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---