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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/compiler.dart

Issue 324293002: Improve parser error recovery. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed Johnni's comments Created 6 years, 6 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 | dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/sdk/lib/_internal/compiler/implementation/compiler.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
index 7b8420a4f51f4758d2cd94d9680ea989ad89bbff..e0b01b2b8b04882bb2994123d4d6eb7e21118a0c 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -1264,7 +1264,7 @@ abstract class Compiler implements DiagnosticListener {
"library."});
}
} else {
- if (main.isErroneous) {
+ if (main.isErroneous && main.isSynthesized) {
reportFatalError(main, MessageKind.GENERIC,
{'text': "Cannot determine which '$MAIN' to use."});
} else if (!main.isFunction) {
@@ -1652,10 +1652,11 @@ abstract class Compiler implements DiagnosticListener {
}
SourceSpan spanFromElement(Element element) {
- if (Elements.isErroneousElement(element)) {
+ while (element != null && element.isSynthesized) {
element = element.enclosingElement;
}
- if (element.position == null &&
+ if (element != null &&
+ element.position == null &&
!element.isLibrary &&
!element.isCompilationUnit) {
// Sometimes, the backend fakes up elements that have no
« no previous file with comments | « no previous file | dart/sdk/lib/_internal/compiler/implementation/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698