| 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 9ad691915fc523da02190f61526daf5feb89bc69..dc843ebfeeefddd40e1af5f110b6abd2c655ecbf 100644
|
| --- a/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| +++ b/dart/sdk/lib/_internal/compiler/implementation/compiler.dart
|
| @@ -104,6 +104,8 @@ abstract class Compiler implements DiagnosticListener {
|
| final bool enableUserAssertions;
|
| final bool enableConcreteTypeInference;
|
| final bool analyzeAll;
|
| + final bool rejectDeprecatedFeatures;
|
| + final bool omgThisIsALongOptionName;
|
|
|
| bool disableInlining = false;
|
|
|
| @@ -215,6 +217,8 @@ abstract class Compiler implements DiagnosticListener {
|
| bool generateSourceMap: true,
|
| bool disallowUnsafeEval: false,
|
| this.analyzeAll: false,
|
| + this.rejectDeprecatedFeatures: false,
|
| + this.omgThisIsALongOptionName: false,
|
| List<String> strips: const []})
|
| : libraries = new Map<String, LibraryElement>(),
|
| progress = new Stopwatch() {
|
| @@ -331,12 +335,10 @@ abstract class Compiler implements DiagnosticListener {
|
| try {
|
| runCompiler(uri);
|
| } on CompilerCancelledException catch (exception) {
|
| - log(exception.toString());
|
| - log('compilation failed');
|
| + log('Error: $exception');
|
| return false;
|
| }
|
| tracer.close();
|
| - log('compilation succeeded');
|
| return true;
|
| }
|
|
|
| @@ -757,6 +759,19 @@ abstract class Compiler implements DiagnosticListener {
|
| reportDiagnostic(span, "$message", kind);
|
| }
|
|
|
| + void onDeprecatedFeature(Spannable span, String feature) {
|
| + if (!omgThisIsALongOptionName &&
|
| + currentElement.getLibrary().isPlatformLibrary) {
|
| + return;
|
| + }
|
| + var kind = rejectDeprecatedFeatures
|
| + ? api.Diagnostic.ERROR : api.Diagnostic.WARNING;
|
| + var message = rejectDeprecatedFeatures
|
| + ? MessageKind.DEPRECATED_FEATURE_ERROR.error([feature])
|
| + : MessageKind.DEPRECATED_FEATURE_WARNING.error([feature]);
|
| + reportMessage(spanFromSpannable(span), message, kind);
|
| + }
|
| +
|
| void reportDiagnostic(SourceSpan span, String message, api.Diagnostic kind);
|
|
|
| SourceSpan spanFromTokens(Token begin, Token end, [Uri uri]) {
|
|
|