JS backend: fix class object in trait #KT-4062 Fixed

This commit is contained in:
Erokhin Stanislav
2013-10-11 14:42:36 +04:00
parent e6259deb8c
commit 768289b913
3 changed files with 17 additions and 0 deletions
@@ -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;
};