Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8140)

Unified Diff: compiler/java/com/google/dart/compiler/DartCompiler.java

Issue 9420011: Issue 1548. If URI can not be parsed, return null. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/DartCompilerErrorCode.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: compiler/java/com/google/dart/compiler/DartCompiler.java
diff --git a/compiler/java/com/google/dart/compiler/DartCompiler.java b/compiler/java/com/google/dart/compiler/DartCompiler.java
index 8dd9e722ac0f124ae08f0b49456b9b8fa4562da0..73b78054a27a83389642c223aea568f9a5858afb 100644
--- a/compiler/java/com/google/dart/compiler/DartCompiler.java
+++ b/compiler/java/com/google/dart/compiler/DartCompiler.java
@@ -110,12 +110,12 @@ public class DartCompiler {
@Override
public LibrarySource getImportFor(String relPath) {
- throw new AssertionError();
+ return null;
}
@Override
public DartSource getSourceFor(String relPath) {
- throw new AssertionError();
+ return null;
}
}
@@ -249,13 +249,10 @@ public class DartCompiler {
final DartSource dartSrc = libSrc.getSourceFor(relPath);
if (dartSrc == null || !dartSrc.exists()) {
// Dart Editor needs to have all missing files reported as compilation errors.
- // In addition, continue allows lib.populateTopLevelNodes() to be called so that the
- // top level elements are populated preventing an NPE later on.
reportMissingSource(context, libSrc, libNode);
continue;
}
-
if (!incremental
|| (libIsDartUri && !usePrecompiledDartLibs)
|| isSourceOutOfDate(dartSrc, libSrc)) {
@@ -407,12 +404,7 @@ public class DartCompiler {
if (SystemLibraryManager.isDartSpec(libSpec)) {
dep = context.getSystemLibraryFor(libSpec);
} else {
- try {
- dep = libSrc.getImportFor(libSpec);
- } catch (IllegalArgumentException ex) {
- reportImportError(context, libSrc, libNode);
- continue;
- }
+ dep = libSrc.getImportFor(libSpec);
}
if (dep == null || !dep.exists()) {
reportMissingSource(context, libSrc, libNode);
@@ -883,15 +875,6 @@ public class DartCompiler {
event.setSource(libSrc);
context.onError(event);
}
-
- private void reportImportError(DartCompilerContext context,
- LibrarySource libSrc,
- LibraryNode libNode) {
- DartCompilationError event = new DartCompilationError(libNode,
- DartCompilerErrorCode.COULD_NOT_PARSE_IMPORT, libNode.getText());
- event.setSource(libSrc);
- context.onError(event);
- }
CoreTypeProvider getTypeProvider() {
typeProvider.getClass(); // Quick null check.
return typeProvider;
« no previous file with comments | « no previous file | compiler/java/com/google/dart/compiler/DartCompilerErrorCode.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698