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

Unified Diff: dart/pkg/compiler/lib/src/resolution/members.dart

Issue 821593004: Create erroneous element when resolution of initializer fails. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Tests passing locally. 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/enqueue.dart ('k') | dart/pkg/compiler/lib/src/resolution/resolution.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/pkg/compiler/lib/src/resolution/members.dart
diff --git a/dart/pkg/compiler/lib/src/resolution/members.dart b/dart/pkg/compiler/lib/src/resolution/members.dart
index 81ac0d2ef5843dcd973272a26911337c4e0b8e0e..40d197f2d6408f4ebc9a55c5d5d37ba467696ef8 100644
--- a/dart/pkg/compiler/lib/src/resolution/members.dart
+++ b/dart/pkg/compiler/lib/src/resolution/members.dart
@@ -743,9 +743,7 @@ class ResolverTask extends CompilerTask {
Element nextTarget = target.immediateRedirectionTarget;
if (seen.contains(nextTarget)) {
error(node, MessageKind.CYCLIC_REDIRECTING_FACTORY);
- // TODO(ahe): Don't throw, recover from error.
- throw new CompilerCancelledException(null);
- break;
+ return;
}
seen.add(target);
target = nextTarget;
@@ -1412,12 +1410,12 @@ class InitializerResolver {
target = constructor.enclosingClass.lookupLocalMember(name);
if (target == null) {
error(selector, MessageKind.CANNOT_RESOLVE, {'name': name});
- // TODO(ahe): Don't throw, recover from error.
- throw new CompilerCancelledException(null);
+ target = new ErroneousFieldElementX(
+ selector.asIdentifier(), constructor.enclosingClass);
} else if (target.kind != ElementKind.FIELD) {
error(selector, MessageKind.NOT_A_FIELD, {'fieldName': name});
- // TODO(ahe): Don't throw, recover from error.
- throw new CompilerCancelledException(null);
+ target = new ErroneousFieldElementX(
+ selector.asIdentifier(), constructor.enclosingClass);
} else if (!target.isInstanceMember) {
error(selector, MessageKind.INIT_STATIC_FIELD, {'fieldName': name});
}
@@ -2242,8 +2240,6 @@ class ResolverVisitor extends MappingVisitor<ResolutionResult> {
if (node.isThis()) {
if (!inInstanceContext) {
error(node, MessageKind.NO_INSTANCE_AVAILABLE, {'name': node});
- // TODO(ahe): Don't throw, recover from error.
- throw new CompilerCancelledException(null);
}
return null;
} else if (node.isSuper()) {
« no previous file with comments | « dart/pkg/compiler/lib/src/enqueue.dart ('k') | dart/pkg/compiler/lib/src/resolution/resolution.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698