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

Unified Diff: dart/pkg/compiler/lib/src/library_loader.dart

Issue 841653004: Recover from read errors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r42871 Created 5 years, 11 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 | « dart/pkg/compiler/lib/src/elements/modelx.dart ('k') | dart/pkg/compiler/lib/src/script.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/compiler/lib/src/library_loader.dart
diff --git a/dart/pkg/compiler/lib/src/library_loader.dart b/dart/pkg/compiler/lib/src/library_loader.dart
index 1b34560881870aa353596172d4a8a6b116fec224..3e5ddde094dd997f8b3c01f3725d8b95a6e8afd4 100644
--- a/dart/pkg/compiler/lib/src/library_loader.dart
+++ b/dart/pkg/compiler/lib/src/library_loader.dart
@@ -488,7 +488,7 @@ class _LibraryLoaderTask extends CompilerTask implements LibraryLoaderTask {
new CompilationUnitElementX(sourceScript, library);
compiler.withCurrentElement(unit, () {
compiler.scanner.scan(unit);
- if (unit.partTag == null) {
+ if (unit.partTag == null && !sourceScript.isSynthesized) {
compiler.reportError(unit, MessageKind.MISSING_PART_OF_TAG);
}
});
@@ -525,17 +525,19 @@ class _LibraryLoaderTask extends CompilerTask implements LibraryLoaderTask {
LibraryElement importingLibrary,
Uri resolvedUri,
[Node node]) {
- // TODO(johnniwinther): Create erroneous library elements for missing
- // libraries.
Uri readableUri =
compiler.translateResolvedUri(importingLibrary, resolvedUri, node);
- if (readableUri == null) return new Future.value();
LibraryElement library = libraryCanonicalUriMap[resolvedUri];
if (library != null) {
return new Future.value(library);
}
+ var readScript = compiler.readScript;
+ if (readableUri == null) {
+ readableUri = resolvedUri;
+ readScript = compiler.synthesizeScript;
+ }
return compiler.withCurrentElement(importingLibrary, () {
- return compiler.readScript(node, readableUri).then((Script script) {
+ return readScript(node, readableUri).then((Script script) {
if (script == null) return null;
LibraryElement element =
createLibrarySync(handler, script, resolvedUri);
« no previous file with comments | « dart/pkg/compiler/lib/src/elements/modelx.dart ('k') | dart/pkg/compiler/lib/src/script.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698