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

Unified Diff: pkg/front_end/lib/src/fasta/deprecated_problems.dart

Issue 2980863003: The very first bits of resynthesizing elements from kernels. (Closed)
Patch Set: Created 3 years, 5 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: pkg/front_end/lib/src/fasta/deprecated_problems.dart
diff --git a/pkg/front_end/lib/src/fasta/deprecated_problems.dart b/pkg/front_end/lib/src/fasta/deprecated_problems.dart
index 90897d9eeae9ec76da1194649b12facc80bcceed..00ab3370569f2ab25e060f30c5bca8a5ec37f6ff 100644
--- a/pkg/front_end/lib/src/fasta/deprecated_problems.dart
+++ b/pkg/front_end/lib/src/fasta/deprecated_problems.dart
@@ -26,6 +26,13 @@ bool hasCrashed = false;
/// [resetCrashReporting].
Uri firstSourceUri;
+/// This flag is a temporary solution for preventing printing a lot
+/// of information on the console. Analyzer starts using Fasta to generate
+/// kernels to resynthesize its element models from it. We don't want to
+/// see all these errors and warnings on the console, while running test or
+/// in production. TODO(scheglov): remove this flag eventually.
+bool temporaryUntilPrintsRemovedEnablePrinting = true;
+
/// Used to report an error in input.
///
/// Avoid using this for reporting compile-time errors, instead use
@@ -50,7 +57,9 @@ String deprecated_printUnexpected(Uri uri, int charOffset, String message) {
if (isVerbose) print(StackTrace.current);
throw new deprecated_InputError(uri, charOffset, message);
}
- print(formattedMessage);
+ if (temporaryUntilPrintsRemovedEnablePrinting) {
+ print(formattedMessage);
+ }
return formattedMessage;
}

Powered by Google App Engine
This is Rietveld 408576698