The following does not work in the new IR: ```@fil...
# javascript
m
The following does not work in the new IR:
Copy code
@file:JsQualifier("cast.framework.events")
@JsName("EventType")
external enum class PlayerEventType {
 // ...
}
This is because it generates the following line in JavaScript:
Copy code
var EventType = cast.framework.events.EventType;
However, in that scope,
cast
is a function generated by Kotlin (seems to be from the serialization library):
Copy code
function cast(_this_) {
  return isInterface(_this_, KSerializer) ? _this_ : THROW_CCE();
}
This results in the following error:
Copy code
Uncaught TypeError: Cannot read property 'events' of undefined
Any workaround?
b
Please file an issue kotl.in/issue
@mkosm try to add
this.
or
globalThis.
as a prefix of qualifier
m
Thanks,
this.
seems to work!
I'll file an issue soon
🙏 1
Here it is, sorry for the delay: https://youtrack.jetbrains.com/issue/KT-42039
b
Thanks!