| Index: pkg/fletchc/lib/src/fletch_compiler_implementation.dart
|
| diff --git a/pkg/fletchc/lib/src/fletch_compiler_implementation.dart b/pkg/fletchc/lib/src/fletch_compiler_implementation.dart
|
| index c5245ec618a1231fbacfd351ea30d36cf816bbfc..b26f96e833bf1ab5e41250c0c76b1b5fe61c2f88 100644
|
| --- a/pkg/fletchc/lib/src/fletch_compiler_implementation.dart
|
| +++ b/pkg/fletchc/lib/src/fletch_compiler_implementation.dart
|
| @@ -12,10 +12,8 @@ import 'package:sdk_library_metadata/libraries.dart' show
|
|
|
| import 'package:compiler/compiler_new.dart' as api;
|
|
|
| -import 'package:compiler/src/apiimpl.dart' as apiimpl;
|
| -
|
| -import 'package:compiler/src/compiler.dart' show
|
| - GlobalDependencyRegistry;
|
| +import 'package:compiler/src/apiimpl.dart' show
|
| + CompilerImpl;
|
|
|
| import 'package:compiler/src/io/source_file.dart';
|
|
|
| @@ -33,6 +31,7 @@ import 'package:compiler/src/diagnostics/messages.dart' show
|
| Message,
|
| MessageKind,
|
| MessageTemplate;
|
| +
|
| import 'package:compiler/src/diagnostics/source_span.dart' show
|
| SourceSpan;
|
|
|
| @@ -43,9 +42,6 @@ import 'package:compiler/src/diagnostics/diagnostic_listener.dart' show
|
| import 'package:compiler/src/diagnostics/spannable.dart' show
|
| Spannable;
|
|
|
| -import 'fletch_registry.dart' show
|
| - FletchRegistry;
|
| -
|
| import 'please_report_crash.dart' show
|
| crashReportRequested,
|
| requestBugReportOnCompilerCrashMessage;
|
| @@ -59,8 +55,11 @@ import 'fletch_enqueuer.dart' show
|
| FletchEnqueueTask;
|
|
|
| import '../fletch_system.dart';
|
| +
|
| import 'package:compiler/src/diagnostics/diagnostic_listener.dart';
|
| -import 'package:compiler/src/elements/elements.dart';
|
| +
|
| +import 'fletch_diagnostic_reporter.dart' show
|
| + FletchDiagnosticReporter;
|
|
|
| const EXTRA_DART2JS_OPTIONS = const <String>[
|
| // TODO(ahe): This doesn't completely disable type inference. Investigate.
|
| @@ -121,7 +120,7 @@ const Map<String, LibraryInfo> FLETCH_LIBRARIES = const {
|
| platforms: FLETCH_PLATFORM),
|
| };
|
|
|
| -class FletchCompilerImplementation extends apiimpl.CompilerImpl {
|
| +class FletchCompilerImplementation extends CompilerImpl {
|
| final Map<String, LibraryInfo> fletchLibraries = <String, LibraryInfo>{};
|
|
|
| final Uri fletchVm;
|
| @@ -138,7 +137,6 @@ class FletchCompilerImplementation extends apiimpl.CompilerImpl {
|
| // TODO(ahe): Clean this up and remove this.
|
| var helper;
|
|
|
| - @override
|
| FletchEnqueueTask get enqueuer => super.enqueuer;
|
|
|
| FletchDiagnosticReporter reporter;
|
| @@ -172,7 +170,6 @@ class FletchCompilerImplementation extends apiimpl.CompilerImpl {
|
|
|
| String fletchPatchLibraryFor(String name) => FLETCH_PATCHES[name];
|
|
|
| - @override
|
| Uri lookupLibraryUri(String libraryName) {
|
| LibraryInfo info = FLETCH_LIBRARIES[libraryName];
|
| if (info == null) return super.lookupLibraryUri(libraryName);
|
| @@ -306,74 +303,3 @@ SourceFile getSourceFile(api.CompilerInput provider, Uri uri) {
|
| return null;
|
| }
|
| }
|
| -
|
| -/// A wrapper around a DiagnosticReporter, that customizes some messages to
|
| -/// Fletch.
|
| -class FletchDiagnosticReporter extends DiagnosticReporter {
|
| - DiagnosticReporter _internalReporter;
|
| -
|
| - FletchDiagnosticReporter(this._internalReporter);
|
| -
|
| - @override
|
| - DiagnosticMessage createMessage(Spannable spannable,
|
| - MessageKind messageKind,
|
| - [Map arguments = const {}]) {
|
| - return _internalReporter.createMessage(spannable, messageKind, arguments);
|
| - }
|
| -
|
| - @override
|
| - internalError(Spannable spannable, message) {
|
| - return _internalReporter.internalError(spannable, message);
|
| - }
|
| -
|
| - @override
|
| - void log(message) {
|
| - _internalReporter.log(message);
|
| - }
|
| -
|
| - @override
|
| - DiagnosticOptions get options => _internalReporter.options;
|
| -
|
| - @override
|
| - void reportError(DiagnosticMessage message,
|
| - [List<DiagnosticMessage> infos = const <DiagnosticMessage> []]) {
|
| - if (message.message.kind ==
|
| - MessageKind.MIRRORS_LIBRARY_NOT_SUPPORT_BY_BACKEND) {
|
| - const String noMirrors =
|
| - "Fletch doesn't support 'dart:mirrors'. See https://goo.gl/Kwrd0O";
|
| - message = createMessage(message.spannable,
|
| - MessageKind.GENERIC,
|
| - {'text': message});
|
| - }
|
| - _internalReporter.reportError(message, infos);
|
| - }
|
| -
|
| - @override
|
| - void reportHint(DiagnosticMessage message,
|
| - [List<DiagnosticMessage> infos = const <DiagnosticMessage> []]) {
|
| - _internalReporter.reportHint(message, infos);
|
| - }
|
| -
|
| - @override
|
| - void reportInfo(Spannable node,
|
| - MessageKind errorCode,
|
| - [Map arguments = const {}]) {
|
| - _internalReporter.reportInfo(node, errorCode, arguments);
|
| - }
|
| -
|
| - @override
|
| - void reportWarning(DiagnosticMessage message,
|
| - [List<DiagnosticMessage> infos = const <DiagnosticMessage> []]) {
|
| - _internalReporter.reportWarning(message, infos);
|
| - }
|
| -
|
| - @override
|
| - SourceSpan spanFromSpannable(Spannable node) {
|
| - return _internalReporter.spanFromSpannable(node);
|
| - }
|
| -
|
| - @override
|
| - withCurrentElement(Element element, f()) {
|
| - return _internalReporter.withCurrentElement(element, f);
|
| - }
|
| -}
|
|
|