Unverified Commit 9a51588d authored by Alexander Aprelev's avatar Alexander Aprelev Committed by GitHub

Suppress stdout compile diagnostic when compile expressions. (#18703)

* Suppress stdout compile diagnostic when compile expressions.

This fixes https://github.com/flutter/flutter/issues/18574.

* Use equal sign for default values
parent b327ac34
......@@ -35,6 +35,8 @@ class _StdoutHandler {
String boundaryKey;
Completer<CompilerOutput> compilerOutput;
bool _suppressCompilerMessages;
void handler(String string) {
const String kResultPrefix = 'result ';
if (boundaryKey == null) {
......@@ -51,15 +53,17 @@ class _StdoutHandler {
string.substring(boundaryKey.length + 1, spaceDelimiter),
int.parse(string.substring(spaceDelimiter + 1).trim())));
}
else
else if (!_suppressCompilerMessages) {
consumer('compiler message: $string');
}
}
// This is needed to get ready to process next compilation result output,
// with its own boundary key and new completer.
void reset() {
void reset({bool suppressCompilerMessages = false}) {
boundaryKey = null;
compilerOutput = new Completer<CompilerOutput>();
_suppressCompilerMessages = suppressCompilerMessages;
}
}
......@@ -394,7 +398,7 @@ class ResidentCompiler {
Future<CompilerOutput> _compileExpression(
_CompileExpressionRequest request) async {
_stdoutHandler.reset();
_stdoutHandler.reset(suppressCompilerMessages: true);
// 'compile-expression' should be invoked after compiler has been started,
// program was compiled.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment