js: rename "anonymous" ns to "root"
also use constant field instead of hardcoded literal in tests
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package org.jetbrains.k2js.test.rhino;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.k2js.translate.context.Namer;
|
||||
import org.jetbrains.k2js.utils.GenerationUtils;
|
||||
import org.mozilla.javascript.Context;
|
||||
import org.mozilla.javascript.Scriptable;
|
||||
@@ -58,7 +59,7 @@ public final class RhinoSystemOutputChecker implements RhinoResultChecker {
|
||||
}
|
||||
|
||||
private void runMain(Context context, Scriptable scope) {
|
||||
String callToMain = GenerationUtils.generateCallToMain("Anonymous", arguments);
|
||||
String callToMain = GenerationUtils.generateCallToMain(Namer.getRootNamespaceName(), arguments);
|
||||
context.evaluateString(scope, callToMain, "function call", 0, null);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import junit.framework.Test;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.k2js.test.BasicTest;
|
||||
import org.jetbrains.k2js.test.SingleFileTranslationTest;
|
||||
import org.jetbrains.k2js.translate.context.Namer;
|
||||
|
||||
@SuppressWarnings("JUnitTestCaseWithNoTests")
|
||||
public final class ExamplesTest extends SingleFileTranslationTest {
|
||||
@@ -35,7 +36,7 @@ public final class ExamplesTest extends SingleFileTranslationTest {
|
||||
|
||||
@Override
|
||||
public void runTest() throws Exception {
|
||||
runFunctionOutputTest(filename, "Anonymous", "box", "OK");
|
||||
runFunctionOutputTest(filename, Namer.getRootNamespaceName(), "box", "OK");
|
||||
}
|
||||
|
||||
public static Test suite() throws Exception {
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.jetbrains.k2js.test.semantics;
|
||||
|
||||
import org.jetbrains.k2js.translate.context.Namer;
|
||||
|
||||
/**
|
||||
* @author Pavel Talanov
|
||||
*/
|
||||
@@ -58,7 +60,7 @@ public class FunctionTest extends AbstractExpressionTest {
|
||||
}
|
||||
|
||||
public void testEnclosingThis() throws Exception {
|
||||
runFunctionOutputTest("enclosingThis.kt", "Anonymous", "box", "OK");
|
||||
runFunctionOutputTest("enclosingThis.kt", Namer.getRootNamespaceName(), "box", "OK");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.k2js.test.semantics;
|
||||
|
||||
import org.jetbrains.k2js.translate.context.Namer;
|
||||
import org.mozilla.javascript.JavaScriptException;
|
||||
|
||||
/**
|
||||
@@ -45,7 +46,7 @@ public final class MiscTest extends AbstractExpressionTest {
|
||||
}
|
||||
|
||||
public void testClassWithoutNamespace() throws Exception {
|
||||
runFunctionOutputTest("classWithoutNamespace.kt", "Anonymous", "box", true);
|
||||
runFunctionOutputTest("classWithoutNamespace.kt", Namer.getRootNamespaceName(), "box", true);
|
||||
}
|
||||
|
||||
public void testIfElseAsExpressionWithThrow() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user