JS backend: fix class object in trait #KT-4062 Fixed
This commit is contained in:
@@ -12,6 +12,10 @@ public final class ClassObjectTest extends SingleFileTranslationTest {
|
||||
checkFooBoxIsOk();
|
||||
}
|
||||
|
||||
public void testInTrait() throws Exception {
|
||||
checkFooBoxIsOk();
|
||||
}
|
||||
|
||||
public void testWithExtension() throws Exception {
|
||||
checkFooBoxIsOk();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package foo
|
||||
|
||||
trait A {
|
||||
class object
|
||||
{
|
||||
val OK: String = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return A.OK
|
||||
}
|
||||
@@ -233,6 +233,7 @@ var Kotlin = {};
|
||||
obj.prototype = {};
|
||||
Object.defineProperties(obj.prototype, obj.$metadata$.properties);
|
||||
copyProperties(obj.prototype, obj.$metadata$.functions);
|
||||
Object.defineProperty(obj, "object", {get: class_object, configurable: true});
|
||||
return obj;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user