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 9dd9ab58701c4a58cc784c1425ab6979c6462d09..88d35c5b5e09c04ad7913bb54136a2fed13d1890 100644 |
--- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart |
+++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart |
@@ -329,6 +329,9 @@ abstract class Compiler implements DiagnosticListener { |
*/ |
final String globalJsName; |
+ /// Emit terse diagnostics without howToFix. |
+ final bool terseDiagnostics; |
+ |
final api.CompilerOutputProvider outputProvider; |
bool disableInlining = false; |
@@ -385,6 +388,9 @@ abstract class Compiler implements DiagnosticListener { |
// Initialized when symbolImplementationClass has been resolved. |
FunctionElement symbolValidatedConstructor; |
+ // Initialized when mirrorsUsedClass has been resolved. |
+ FunctionElement mirrorsUsedConstructor; |
+ |
// Initialized when dart:mirrors is loaded. |
ClassElement deferredLibraryClass; |
@@ -521,6 +527,7 @@ abstract class Compiler implements DiagnosticListener { |
this.sourceMapUri: null, |
this.buildId: UNDETERMINED_BUILD_ID, |
this.globalJsName: r'$', |
+ this.terseDiagnostics: false, |
outputProvider, |
List<String> strips: const []}) |
: this.analyzeOnly = analyzeOnly || analyzeSignaturesOnly, |
@@ -742,6 +749,8 @@ abstract class Compiler implements DiagnosticListener { |
} else if (symbolImplementationClass == cls) { |
symbolValidatedConstructor = symbolImplementationClass.lookupConstructor( |
symbolValidatedConstructorSelector); |
+ } else if (mirrorsUsedClass == cls) { |
+ mirrorsUsedConstructor = cls.constructors.head; |
} |
} |
@@ -797,7 +806,9 @@ abstract class Compiler implements DiagnosticListener { |
'$missingHelperClasses'); |
} |
- types = new Types(this, dynamicClass); |
+ if (types == null) { |
+ types = new Types(this, dynamicClass); |
+ } |
backend.initializeHelperClasses(); |
dynamicClass.ensureResolved(this); |
@@ -1167,7 +1178,7 @@ abstract class Compiler implements DiagnosticListener { |
MessageKind errorCode, |
[Map arguments = const {}]) { |
reportMessage(spanFromSpannable(node), |
- errorCode.error(arguments), |
+ errorCode.error(arguments, terseDiagnostics), |
api.Diagnostic.ERROR); |
} |
@@ -1183,21 +1194,21 @@ abstract class Compiler implements DiagnosticListener { |
void reportWarningCode(Spannable node, MessageKind errorCode, |
[Map arguments = const {}]) { |
reportMessage(spanFromSpannable(node), |
- errorCode.error(arguments), |
+ errorCode.error(arguments, terseDiagnostics), |
api.Diagnostic.WARNING); |
} |
void reportInfo(Spannable node, MessageKind errorCode, |
[Map arguments = const {}]) { |
reportMessage(spanFromSpannable(node), |
- errorCode.error(arguments), |
+ errorCode.error(arguments, terseDiagnostics), |
api.Diagnostic.INFO); |
} |
void reportHint(Spannable node, MessageKind errorCode, |
[Map arguments = const {}]) { |
reportMessage(spanFromSpannable(node), |
- errorCode.error(arguments), |
+ errorCode.error(arguments, terseDiagnostics), |
api.Diagnostic.HINT); |
} |