mkosm
09/18/2020, 9:08 AM@file:JsQualifier("cast.framework.events")
@JsName("EventType")
external enum class PlayerEventType {
// ...
}
This is because it generates the following line in JavaScript:
var EventType = cast.framework.events.EventType;
However, in that scope, cast
is a function generated by Kotlin (seems to be from the serialization library):
function cast(_this_) {
return isInterface(_this_, KSerializer) ? _this_ : THROW_CCE();
}
This results in the following error:
Uncaught TypeError: Cannot read property 'events' of undefined
Any workaround?bashor
09/18/2020, 10:08 AMbashor
09/18/2020, 10:20 AMthis.
or globalThis.
as a prefix of qualifiermkosm
09/18/2020, 10:28 AMthis.
seems to work!mkosm
09/18/2020, 10:28 AMmkosm
09/19/2020, 9:02 AMbashor
09/19/2020, 9:51 AM