diff --git a/js/js.tests/test/org/jetbrains/k2js/test/semantics/FunctionTest.java b/js/js.tests/test/org/jetbrains/k2js/test/semantics/FunctionTest.java index 3042bbe287f..296d3fb1256 100644 --- a/js/js.tests/test/org/jetbrains/k2js/test/semantics/FunctionTest.java +++ b/js/js.tests/test/org/jetbrains/k2js/test/semantics/FunctionTest.java @@ -16,8 +16,6 @@ package org.jetbrains.k2js.test.semantics; -import org.jetbrains.k2js.translate.context.Namer; - /** * @author Pavel Talanov */ @@ -60,7 +58,7 @@ public class FunctionTest extends AbstractExpressionTest { } public void testEnclosingThis() throws Exception { - runFunctionOutputTest("enclosingThis.kt", Namer.getRootNamespaceName(), "box", "OK"); + runFunctionOutputTest("enclosingThis.kt", "foo", "box", "OK"); } @@ -109,4 +107,8 @@ public class FunctionTest extends AbstractExpressionTest { public void testFunctionInsideFunction() throws Exception { fooBoxTest(); } + + public void testCallFunInInit() throws Exception { + fooBoxTest(); + } } diff --git a/js/js.translator/testFiles/expression/function/cases/callFunInInit.kt b/js/js.translator/testFiles/expression/function/cases/callFunInInit.kt new file mode 100644 index 00000000000..ecbf611936d --- /dev/null +++ b/js/js.translator/testFiles/expression/function/cases/callFunInInit.kt @@ -0,0 +1,9 @@ +package foo + +class A() + +private val doInit = { + A() +}() + +fun box(): Boolean = doInit is A