I wrote simple kt-class with `testMe` method. I ca...
# javascript
l
I wrote simple kt-class with
testMe
method. I can't call it in old js: I see
testMe_61zpoe$
k
Look up the
@JsName
annotation.
l
omg... Do I need to write @JsName for each method I want to use in outer js???
k
Yes, you have to
k
Is there no version that applies to a whole file or something? This is quite annoying when you have to reference event handlers from within html for example.
l
k
There's none still, but we are going to design one eventually
k
@lewik Because it doesn't have any parameters.
k
@lewik the rule is simple: functions without arguments and preoperties get tranlated as is, function with arguments (or extension receivers) get mangled
k
@konsoletyper, Okay, thanks!
l
@konsoletyper Thank you
@konsoletyper When whole project is in kotlin - we don't need @JsName annotation?
k
@lewik yes, you don't need this annotation to call Kotlin from Kotlin