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

Unified Diff: lib/compiler/implementation/dart_backend/placeholder_collector.dart

Issue 10829439: Introduce unreachable helper. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/dart_backend/placeholder_collector.dart
diff --git a/lib/compiler/implementation/dart_backend/placeholder_collector.dart b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
index 4c958bd768725333d6af2cc0ce3a26bd3bff1ac2..7934235f296fc768fe964768bb01e5af22a7fc23 100644
--- a/lib/compiler/implementation/dart_backend/placeholder_collector.dart
+++ b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
@@ -143,7 +143,7 @@ class PlaceholderCollector extends AbstractVisitor {
tryMakePrivateIdentifier(
send.selector.asFunctionExpression().name.asIdentifier());
} else {
- internalError('Unreachable case');
+ unreachable();
}
} else {
assert(definition is Identifier
@@ -180,7 +180,7 @@ class PlaceholderCollector extends AbstractVisitor {
tryMakePrivateIdentifier(
definition.asSendSet().selector.asIdentifier());
} else {
- internalError('Unreachable case');
+ unreachable();
}
}
} else if (element.isTopLevel()) {
@@ -190,7 +190,7 @@ class PlaceholderCollector extends AbstractVisitor {
} else if (fieldNode is SendSet) {
makeElementPlaceholder(fieldNode.selector, element);
} else {
- internalError('Unreachable case');
+ unreachable();
}
}
}
@@ -214,7 +214,7 @@ class PlaceholderCollector extends AbstractVisitor {
currentElement = element;
elementNode = currentElement.parseNode(compiler);
} else {
- assert(false); // Unreachable.
+ unreachable();
}
currentLocalPlaceholders = new Map<String, LocalPlaceholder>();
compiler.withCurrentElement(element, () {
@@ -279,6 +279,8 @@ class PlaceholderCollector extends AbstractVisitor {
compiler.cancel(reason: reason, node: node);
}
+ void unreachable() { internalError('Unreachable case'); }
+
visit(Node node) => (node === null) ? null : node.accept(this);
visitNode(Node node) { node.visitChildren(this); } // We must go deeper.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698