Trailing _0 in variable names and -generateJsInteropExports flag

87 views
Skip to first unread message

Yann Vo

unread,
Sep 26, 2016, 5:50:22 AM9/26/16
to GWT Users
Hello,

I just raised https://github.com/gwtproject/gwt/issues/9431 for which I had a quick rely (thanks for that!) but... it was closed and flagged invalid.

Rather than polluting the bug database further, I open this thread (which I would have done initially if I had not considered this behavior as a regression wrt 2.8beta1).

Now my question: I have done the suggested change: I added -generateJsInteropExports in my compile command, but it does not seem to do any good...


Whether I add -nogenerateJsInteropExports or -generateJsInteropExports does not seem to change anything (and if I make an intentional typo -nogenerateJsInteropExportypos, the compiler yells which proves that my flags are properly passed to the compiler).

After some research I am still stuck... Can it be that my custom linker (to make the generated code work in a web worker) is the cause of the problem?

Thanks in advance for your attention!

Best regards

Yann Vo

unread,
Sep 26, 2016, 6:00:44 AM9/26/16
to GWT Users
BTW, of course, I could add the isNative=true and define my messages "DTOs" in pure JavaScript.
The goal of my issue and this message were not to get a working solution but rather to avoid a nasty bug in 2.8.0 final...

Thomas Broyer

unread,
Sep 26, 2016, 6:02:29 AM9/26/16
to GWT Users
I just cloned your repository (at 37e4751bf5c1a914a65df8c8da9e5d311f55e78f) and ran a "./gradlew gwtCompile", and the generated JS has:
_.onMessage = function onMessage(message){
  var msg;
  msg = new cewd.MyWorkerMessage;
  msg.code = 'OK';
  msg.payload = cew.createBuffer(50);
  this.postMessage_0(msg);
}
;

So it seems to be working as intended.

Yann Vo

unread,
Sep 26, 2016, 6:19:17 AM9/26/16
to GWT Users
Hello Thomas, thanks for giving it a try! Indeed, it works! Now I feel so stupid! :(

Apparently some pieces must have been remaining from my previous builds... anyway... Jens and Thomas, thanks again for your time and my apologies for the noise!
Reply all
Reply to author
Forward
0 new messages