Tuesday, May 12, 2020

Re: JsInterop - fail to iterate @JsType in List

I think you can achieve this by using Babel: https://babeljs.io/ . A lot of JS-Libs use this for shipping and "Legacy"-support. See also: https://medium.com/hired-engineering/setting-up-monaco-with-jest-e1e4c963ac

Am Dienstag, 12. Mai 2020 12:14:50 UTC+2 schrieb Freddy Boucher:
@Jens

Good catch! It does work with the following javascript:

  <script>
   function Car() {
     this.start = function () {
       return "start";
     }
   }

    var car = new Car();
 </script>

But as you guessed, this is just some dummy code, my real javascript is the Microsoft Monaco Editor and of course I don't have any control on it.
What is the recommended approach in that case?

Thank you


On Tuesday, May 12, 2020 at 7:47:05 PM UTC+10, Jens wrote:

Other ideas?

Maybe because you have used a ES6 / ECMAScript2015 class in your custom JS instead of a traditional function() based JS class. For example web components also use ES6 classes and it is not straight forward to use them with JsInterop / GWT.

I would start SDM / Compiler with -style PRETTY and look at / debug the JS to see why a cast exception occurs or try define the class without using ES6.

-- J.


--
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 google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/06ae444e-4dae-4db1-9357-7b79a359e246%40googlegroups.com.

No comments:

Post a Comment