This worked! Thank you. 

On Friday, November 30, 2018 at 8:49:34 PM UTC+5:30, David Nouls wrote:
>
> try ‘default’ instead
> On 30 Nov 2018, 15:17 +0100, Dylan DSouza <[email protected] <javascript:>>, 
> 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};
>     console.log(object1.default);
> }-*/;
>
> 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 
> <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer>
>  
> 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 
> <https://developers.facebook.com/docs/games/instant-games/sdk/fbinstant6.2#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 [email protected] <javascript:>.
> To post to this group, send email to [email protected] 
> <javascript:>.
> Visit this group at https://groups.google.com/group/google-web-toolkit.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to