JS backend: generate ref for not public api open classes as ref to internal class pool (_c var), but not to namespace definition.

(cherry picked from commit fa3db43)
This commit is contained in:
develar
2013-08-22 19:35:55 +04:00
committed by Zalim Bashorov
parent c27fb10f5a
commit df0a218015
3 changed files with 37 additions and 8 deletions
@@ -1,9 +1,9 @@
package foo
trait A {
public trait A {
fun foo() {}
}
trait B : A {
public trait B : A {
fun boo() {}
}
@@ -12,7 +12,6 @@ native val undefined: Any = noImpl
native class Function(vararg args: String)
val hasProp = Function("obj, prop", "return obj[prop] !== undefined") as ((Any, String)->Boolean)
val PREFIX = "Kotlin.modules.JS_TESTS.foo"
fun box(): String {
val a = object: A {}
@@ -24,6 +23,9 @@ fun box(): String {
if (!hasProp(b, "foo")) return "B hasn't foo"
if (!hasProp(b, "boo")) return "B hasn't boo"
val PREFIX = "Kotlin.modules.JS_TESTS.foo"
if (eval("$PREFIX.A") == null) return "$PREFIX.A not found"
if (eval("$PREFIX.B") == null) return "$PREFIX.B not found"
if (eval("$PREFIX.A === $PREFIX.B") as Boolean) return "A and B refer to the same object"
return "OK"