Javascript compiler doesn't respect javascript style


#1

I'm trying to make a wrapper for a javascript library. However I have problems with namespaces in javascript.

For example.

public native object A
{

  public native class B() {}
}

val a = A.B()

translates to new B() in javascript and ignores the top-level object.
If B is declared as a function compiler respects the top-level object, but doesn’t call B() with new.

How can I work around this?


#2

By defining name property of native annotation one can define the native side name for a class; example: native(name = "Me.NativeClass") public class NativeClass {}


#3

Please star or vote for http://youtrack.jetbrains.com/issue/KT-4298 to receive news about this.