You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
WARNING: Error in @JSBody script line 0, char 33: missing ; before statement
at ca.weblite.teavm.webcomponent.WebComponentRegistry.registerNative
WARNING: Error in @JSBody script line 0, char 41: missing ; before statement
at ca.weblite.teavm.webcomponent.WebComponentRegistry.registerNative
WARNING: Error in @JSBody script line 0, char 53: missing ; before statement
at ca.weblite.teavm.webcomponent.WebComponentRegistry.registerNative
WARNING: Error in @JSBody script line 0, char 54: missing ; before statement
at ca.weblite.teavm.webcomponent.WebComponentRegistry.registerNative
WARNING: Error in @JSBody script line 1, char 5: illegal character: #
at ca.weblite.teavm.webcomponent.WebComponentRegistry.registerNative
WARNING: Error in @JSBody script line 1, char 5: missing } in compound statement
at ca.weblite.teavm.webcomponent.WebComponentRegistry.registerNative
WARNING: Error in @JSBody script line 1, char 5: missing } after function body
at ca.weblite.teavm.webcomponent.WebComponentRegistry.registerNative
The text was updated successfully, but these errors were encountered:
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?
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:
The text was updated successfully, but these errors were encountered: