Unverified Commit 4ad190e7 authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Make CompilerOutput immutable (#16942)

CompilerOutput values should never be mutated. Also includes minor
formatting change to the compile() method signature in line with the
style guide.

Minor housekeeping while I'm touching other bits of nearby code.
parent f570e046
...@@ -19,10 +19,10 @@ KernelCompiler get kernelCompiler => context[KernelCompiler]; ...@@ -19,10 +19,10 @@ KernelCompiler get kernelCompiler => context[KernelCompiler];
typedef void CompilerMessageConsumer(String message); typedef void CompilerMessageConsumer(String message);
class CompilerOutput { class CompilerOutput {
String outputFilename; final String outputFilename;
int errorCount; final int errorCount;
CompilerOutput(this.outputFilename, this.errorCount); const CompilerOutput(this.outputFilename, this.errorCount);
} }
class _StdoutHandler { class _StdoutHandler {
...@@ -65,8 +65,8 @@ class _StdoutHandler { ...@@ -65,8 +65,8 @@ class _StdoutHandler {
class KernelCompiler { class KernelCompiler {
const KernelCompiler(); const KernelCompiler();
Future<CompilerOutput> compile( Future<CompilerOutput> compile({
{String sdkRoot, String sdkRoot,
String mainPath, String mainPath,
String outputFilePath, String outputFilePath,
String depFilePath, String depFilePath,
...@@ -78,7 +78,8 @@ class KernelCompiler { ...@@ -78,7 +78,8 @@ class KernelCompiler {
String incrementalCompilerByteStorePath, String incrementalCompilerByteStorePath,
String packagesPath, String packagesPath,
List<String> fileSystemRoots, List<String> fileSystemRoots,
String fileSystemScheme}) async { String fileSystemScheme,
}) async {
final String frontendServer = artifacts.getArtifactPath( final String frontendServer = artifacts.getArtifactPath(
Artifact.frontendServerSnapshotForEngineDartSdk Artifact.frontendServerSnapshotForEngineDartSdk
); );
......
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