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

Unified Diff: pkg/compiler/lib/src/compiler.dart

Issue 1382603002: dart2js: provide a better error-message, when a backend doesn't support mirrors. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Refactor. Created 5 years, 3 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 | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index daa630c1a5fe9659ae7d6b8b9145bd2acc238134..6854c9b506995aaa669a89bda95f1ed6a36bc493 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -871,21 +871,24 @@ abstract class Compiler extends DiagnosticListener {
return null;
}
- if (!enableExperimentalMirrors &&
- loadedLibraries.containsLibrary(Uris.dart_mirrors)) {
+ bool importsMirrorsLibrary =
+ loadedLibraries.containsLibrary(Uris.dart_mirrors);
+ if (importsMirrorsLibrary && !backend.supportsReflection) {
Set<String> importChains =
computeImportChainsFor(loadedLibraries, Uris.dart_mirrors);
- if (!backend.supportsReflection) {
- reportErrorMessage(
- NO_LOCATION_SPANNABLE,
- MessageKind.MIRRORS_LIBRARY_NOT_SUPPORT_BY_BACKEND);
- } else {
- reportWarningMessage(
- NO_LOCATION_SPANNABLE,
- MessageKind.IMPORT_EXPERIMENTAL_MIRRORS,
- {'importChain': importChains.join(
- MessageTemplate.IMPORT_EXPERIMENTAL_MIRRORS_PADDING)});
- }
+ reportErrorMessage(
+ NO_LOCATION_SPANNABLE,
+ MessageKind.MIRRORS_LIBRARY_NOT_SUPPORT_BY_BACKEND,
+ {'importChain': importChains.join(
+ MessageTemplate.MIRRORS_NOT_SUPPORTED_BY_BACKEND_PADDING)});
+ } else if (importsMirrorsLibrary && !enableExperimentalMirrors) {
+ Set<String> importChains =
+ computeImportChainsFor(loadedLibraries, Uris.dart_mirrors);
+ reportWarningMessage(
+ NO_LOCATION_SPANNABLE,
+ MessageKind.IMPORT_EXPERIMENTAL_MIRRORS,
+ {'importChain': importChains.join(
+ MessageTemplate.IMPORT_EXPERIMENTAL_MIRRORS_PADDING)});
}
functionClass.ensureResolved(this);
« no previous file with comments | « no previous file | pkg/compiler/lib/src/diagnostics/messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698