Open shannah opened 2 months ago
This is because TeaVM uses Rhino to parse JS. Rhino does not fully conform ES2015, not even close. Writing own JS parser is a lot of work, patching Rhino is impossible due to licensing issues. Anyway, for me it seems strange to have large pieces of code inside @JSBody
. Would not just subclassing HTMLElement
in Java side enough? AFAIR, there are only few issues preventing that: properly define class's prototype via Reflection.construct
and ability to take class as a value (or rather passing Class
to native JS methods). What do you think?
Would not just subclassing HTMLElement in Java side enough?
I'm creating custom elements by following the structure described in this MDN doc.
It is actually working really nicely. Just these warning are unsettling, so I thought I'd post them.
I first attempted to translate these structure into the old function/prototype style classes, but wasn't able to get it to work.
What kinds of things are likely to break when warnings like this occur?
The following example prints warning messages to the console on compile, but the app works. I think it is related to an attempt to parse the Javascript class.
The warnings I receive are: