From 4ad190e74ff79348c6e7a6c3676c2e1d6c4e47a8 Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Tue, 24 Apr 2018 16:48:04 -0700 Subject: [PATCH] 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. --- packages/flutter_tools/lib/src/compile.dart | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/flutter_tools/lib/src/compile.dart b/packages/flutter_tools/lib/src/compile.dart index dfab8d34e4..73483700dc 100644 --- a/packages/flutter_tools/lib/src/compile.dart +++ b/packages/flutter_tools/lib/src/compile.dart @@ -19,10 +19,10 @@ KernelCompiler get kernelCompiler => context[KernelCompiler]; typedef void CompilerMessageConsumer(String message); class CompilerOutput { - String outputFilename; - int errorCount; + final String outputFilename; + final int errorCount; - CompilerOutput(this.outputFilename, this.errorCount); + const CompilerOutput(this.outputFilename, this.errorCount); } class _StdoutHandler { @@ -65,8 +65,8 @@ class _StdoutHandler { class KernelCompiler { const KernelCompiler(); - Future compile( - {String sdkRoot, + Future compile({ + String sdkRoot, String mainPath, String outputFilePath, String depFilePath, @@ -78,7 +78,8 @@ class KernelCompiler { String incrementalCompilerByteStorePath, String packagesPath, List fileSystemRoots, - String fileSystemScheme}) async { + String fileSystemScheme, + }) async { final String frontendServer = artifacts.getArtifactPath( Artifact.frontendServerSnapshotForEngineDartSdk );