JS frontend: introduce some JavaScript specific constants.
This commit is contained in:
@@ -18,6 +18,7 @@ package org.jetbrains.k2js.test.semantics;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.k2js.JavaScript;
|
||||
import org.jetbrains.k2js.config.EcmaVersion;
|
||||
import org.jetbrains.k2js.test.SingleFileTranslationTest;
|
||||
|
||||
@@ -38,7 +39,7 @@ public final class NativeInteropTest extends SingleFileTranslationTest {
|
||||
protected List<String> additionalJsFiles(@NotNull EcmaVersion ecmaVersion) {
|
||||
List<String> result = Lists.newArrayList(super.additionalJsFiles(ecmaVersion));
|
||||
|
||||
String jsFilePath = pathToTestDir() + NATIVE + "/" + getTestName(true) + ".js";
|
||||
String jsFilePath = pathToTestDir() + NATIVE + "/" + getTestName(true) + JavaScript.DOT_EXTENSION;
|
||||
File jsFile = new File(jsFilePath);
|
||||
if (jsFile.exists() && jsFile.isFile()) {
|
||||
result.add(jsFilePath);
|
||||
|
||||
@@ -16,12 +16,11 @@
|
||||
|
||||
package org.jetbrains.k2js.test.utils;
|
||||
|
||||
import com.google.dart.compiler.backend.js.ast.JsFunction;
|
||||
import com.google.dart.compiler.backend.js.ast.JsNode;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.k2js.JavaScript;
|
||||
import org.jetbrains.k2js.config.EcmaVersion;
|
||||
|
||||
import java.io.File;
|
||||
@@ -43,7 +42,7 @@ public final class JsTestUtils {
|
||||
|
||||
@NotNull
|
||||
public static String convertFileNameToDotJsFile(@NotNull String filename, @NotNull EcmaVersion ecmaVersion) {
|
||||
String postFix = "_" + ecmaVersion.toString() + ".js";
|
||||
String postFix = "_" + ecmaVersion.toString() + JavaScript.DOT_EXTENSION;
|
||||
int index = filename.lastIndexOf('.');
|
||||
if (index < 0) {
|
||||
return filename + postFix;
|
||||
|
||||
Reference in New Issue
Block a user