Friday, November 30, 2018

Re: GWT compiler isn't allowing 'default' as a javascript object property in my JSNI block

try 'default' instead
On 30 Nov 2018, 15:17 +0100, Dylan DSouza <>, wrote:
I'm porting my Java LIBGDX game to Javascript. There's some JSNI code that looks something like this:

private native void hello()
    var object1 = {default: 'foo', b: 42};

GWT refuses to compile this, giving me this error:

      [ERROR] Line 38: invalid property id
>       var object1 = {default: 'foo', b: 42, c: {}};
> ------------------------^
I tried the same code in native Javascript here and it works fine.

I'm guessing 'default' is some kind of keyword that GWT isn't allowing but I need to use it, because its expected by the interface I need to send the object to, specifically the Facebook Instant SDK and its LocalizableContent object.

Any help will be appreciated!

You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment