Friday, April 29, 2011

GWT JavaScriptObject reading "delete" property

I have the following native method in a extended JavaScriptObject class:

public final native boolean getDelete()  /*-{ return this.delete; }-*/;

but this apparently doesn't work as "delete" is an javascript operator.

How can I read this property correctly.

The thrown exception is:

com.google.gwt.dev.js.JsParserException: missing name after . operator

From stackoverflow
  • Try it by accessing it as string:

    public final native boolean getDelete()  /*-{ return this['delete']; }-*/;
    
    Drejc : This is it ... every property can be accessed from a hash table.

0 comments:

Post a Comment