You are currently viewing Is it possible to get JsName of a method?

Is it possible to get JsName of a method?

I’m making a thing that is able to create mocks for unit testing (basically by adding lambdas to js(“{}”) object and then doing unsafe cast to original type) and for now I require that on every field of a mocked class there is a @JsName annotation that sets the same name as actual method name. And as a result, it doesn’t work with overloaded methods.

Is there any way to get jsName directly from the method reference? Or, if this is not possible, value in @JsName annotation?

submitted by /u/L_James
[link] [comments]