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.
This commit is contained in:
Chris Bracken
2018-04-24 16:48:04 -07:00
committed by GitHub
parent f570e046c9
commit 4ad190e74f

View File

@@ -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<CompilerOutput> compile(
{String sdkRoot,
Future<CompilerOutput> compile({
String sdkRoot,
String mainPath,
String outputFilePath,
String depFilePath,
@@ -78,7 +78,8 @@ class KernelCompiler {
String incrementalCompilerByteStorePath,
String packagesPath,
List<String> fileSystemRoots,
String fileSystemScheme}) async {
String fileSystemScheme,
}) async {
final String frontendServer = artifacts.getArtifactPath(
Artifact.frontendServerSnapshotForEngineDartSdk
);