Minor code improvements and TODO fixes.

This commit is contained in:
pTalanov
2012-05-05 22:03:42 +04:00
parent 9a026aef3f
commit 7b30cc3269
4 changed files with 9 additions and 31 deletions
@@ -49,7 +49,6 @@ public final class TestConfig extends Config {
List<JetFile> libFiles = new ArrayList<JetFile>();
for (String libFileName : LIB_FILE_NAMES) {
JetFile file = null;
//TODO: close stream?
try {
@SuppressWarnings("IOResourceOpenedButNotSafelyClosed")
InputStream stream = new FileInputStream(LIBRARIES_LOCATION + libFileName);
@@ -70,6 +69,7 @@ public final class TestConfig extends Config {
return libFiles;
}
@Override
@NotNull
public List<JetFile> generateLibFiles() {
if (jsLibFiles == null) {
@@ -94,13 +94,13 @@ public class FunctionTest extends AbstractExpressionTest {
}
//TODO: disabled. Probable cause : vars in closures.
//
// public void testKT921() throws Exception {
//
// checkOutput("KT-921.kt", "1,\n" +
// "1, 2,\n" +
// "2, ");
// }
//public void testKT921() throws Exception {
//
// checkOutput("KT-921.kt", "1,\n" +
// "1, 2,\n" +
// "2, ");
//}
public void testFunctionInsideFunction() throws Exception {
fooBoxTest();
@@ -39,7 +39,6 @@ import org.jetbrains.jet.lang.types.lang.JetStandardClasses;
import org.jetbrains.k2js.config.Config;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;
@@ -67,7 +66,7 @@ public final class AnalyzerFacadeForJS {
final ModuleDescriptor owner = new ModuleDescriptor("<module>");
Predicate<PsiFile> completely = Predicates.<PsiFile>and(notLibFiles(config.getLibFiles()), filesToAnalyzeCompletely);
Predicate<PsiFile> completely = Predicates.and(notLibFiles(config.getLibFiles()), filesToAnalyzeCompletely);
TopDownAnalysisParameters topDownAnalysisParameters = new TopDownAnalysisParameters(completely, false, false);
@@ -115,25 +114,6 @@ public final class AnalyzerFacadeForJS {
return result;
}
//TODO: exclude?
@NotNull
public static BindingContext analyzeNamespace(@NotNull JetFile file) {
BindingTraceContext bindingTraceContext = new BindingTraceContext();
Project project = file.getProject();
final ModuleDescriptor owner = new ModuleDescriptor("<module>");
TopDownAnalysisParameters topDownAnalysisParameters = new TopDownAnalysisParameters(
Predicates.<PsiFile>alwaysTrue(), false, false);
InjectorForTopDownAnalyzerForJs injector = new InjectorForTopDownAnalyzerForJs(
project, topDownAnalysisParameters, new ObservableBindingTrace(bindingTraceContext), owner,
JetControlFlowDataTraceFactory.EMPTY, JsConfiguration.jsLibConfiguration(project));
injector.getTopDownAnalyzer().analyzeFiles(Collections.singletonList(file));
return bindingTraceContext.getBindingContext();
}
private static final class JsConfiguration implements ModuleConfiguration {
@NotNull
@@ -36,8 +36,6 @@ import java.io.FileWriter;
import java.io.IOException;
import java.util.*;
//TODO: clean up the code
/**
* @author Pavel Talanov
* <p/>