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

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

Issue 15689009: Type check try statements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Handle invalid type count. Created 7 years, 7 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
Index: sdk/lib/_internal/compiler/implementation/compiler.dart
diff --git a/sdk/lib/_internal/compiler/implementation/compiler.dart b/sdk/lib/_internal/compiler/implementation/compiler.dart
index a292e28965ec15dd2291f0dd75cebf14faab630b..f0026a279e4b3788a4c72bf220aa10f8299c6daa 100644
--- a/sdk/lib/_internal/compiler/implementation/compiler.dart
+++ b/sdk/lib/_internal/compiler/implementation/compiler.dart
@@ -318,6 +318,7 @@ abstract class Compiler implements DiagnosticListener {
ClassElement typeClass;
ClassElement mapClass;
ClassElement symbolClass;
+ ClassElement stackTraceClass;
// Initialized after mirrorSystemClass has been resolved.
FunctionElement symbolConstructor;
@@ -679,6 +680,7 @@ abstract class Compiler implements DiagnosticListener {
listClass = lookupCoreClass('List');
typeClass = lookupCoreClass('Type');
mapClass = lookupCoreClass('Map');
+ stackTraceClass = lookupCoreClass('StackTrace');
if (!missingCoreClasses.isEmpty) {
internalErrorOnElement(coreLibrary,
'dart:core library does not contain required classes: '
@@ -1108,7 +1110,8 @@ abstract class Compiler implements DiagnosticListener {
if (Elements.isErroneousElement(element)) {
element = element.enclosingElement;
}
- if (element.position() == null && !element.isCompilationUnit()) {
+ if (element.position() == null &&
+ !(element.isLibrary() || element.isCompilationUnit())) {
karlklose 2013/05/27 08:45:22 I think !element.isLibrary() && !element.i
Johnni Winther 2013/05/27 11:01:23 Done.
// Sometimes, the backend fakes up elements that have no
// position. So we use the enclosing element instead. It is
// not a good error location, but cancel really is "internal

Powered by Google App Engine
This is Rietveld 408576698