Move TEST_MODULE_NAME to Config and rename to REWRITABLE_MODULE_NAME.
This commit is contained in:
@@ -41,9 +41,6 @@ public class TestConfig extends Config {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//NOTE: hard-coded in kotlin-lib files
|
|
||||||
@NotNull
|
|
||||||
public static final String TEST_MODULE_NAME = "JS_TESTS";
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private final List<JetFile> jsLibFiles;
|
private final List<JetFile> jsLibFiles;
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -51,7 +48,7 @@ public class TestConfig extends Config {
|
|||||||
|
|
||||||
public TestConfig(@NotNull Project project, @NotNull EcmaVersion version,
|
public TestConfig(@NotNull Project project, @NotNull EcmaVersion version,
|
||||||
@NotNull List<JetFile> files, @NotNull BindingContext context) {
|
@NotNull List<JetFile> files, @NotNull BindingContext context) {
|
||||||
super(project, TEST_MODULE_NAME, version);
|
super(project, REWRITABLE_MODULE_NAME, version);
|
||||||
jsLibFiles = files;
|
jsLibFiles = files;
|
||||||
libraryContext = context;
|
libraryContext = context;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
package org.jetbrains.k2js.test.rhino;
|
package org.jetbrains.k2js.test.rhino;
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.k2js.test.config.TestConfig;
|
import org.jetbrains.k2js.config.Config;
|
||||||
import org.jetbrains.k2js.translate.context.Namer;
|
import org.jetbrains.k2js.translate.context.Namer;
|
||||||
import org.mozilla.javascript.Context;
|
import org.mozilla.javascript.Context;
|
||||||
import org.mozilla.javascript.Scriptable;
|
import org.mozilla.javascript.Scriptable;
|
||||||
@@ -36,7 +36,7 @@ public class RhinoFunctionResultChecker implements RhinoResultChecker {
|
|||||||
private final Object expectedResult;
|
private final Object expectedResult;
|
||||||
|
|
||||||
public RhinoFunctionResultChecker(@Nullable String namespaceName, String functionName, Object expectedResult) {
|
public RhinoFunctionResultChecker(@Nullable String namespaceName, String functionName, Object expectedResult) {
|
||||||
this(TestConfig.TEST_MODULE_NAME, namespaceName, functionName, expectedResult);
|
this(Config.REWRITABLE_MODULE_NAME, namespaceName, functionName, expectedResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
public RhinoFunctionResultChecker(@Nullable String moduleId, @Nullable String namespaceName, String functionName, Object expectedResult) {
|
public RhinoFunctionResultChecker(@Nullable String moduleId, @Nullable String namespaceName, String functionName, Object expectedResult) {
|
||||||
|
|||||||
@@ -37,6 +37,11 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public abstract class Config {
|
public abstract class Config {
|
||||||
|
|
||||||
|
//NOTE: hard-coded in kotlin-lib files
|
||||||
|
//NOTE: a hacky solution to be able to rerun code samples with lib loaded only once: used by tests and web demo
|
||||||
|
@NotNull
|
||||||
|
public static final String REWRITABLE_MODULE_NAME = "JS_TESTS";
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static Config getEmptyConfig(@NotNull Project project, @NotNull EcmaVersion ecmaVersion) {
|
public static Config getEmptyConfig(@NotNull Project project, @NotNull EcmaVersion ecmaVersion) {
|
||||||
return new Config(project, "main", ecmaVersion) {
|
return new Config(project, "main", ecmaVersion) {
|
||||||
|
|||||||
Reference in New Issue
Block a user