Skip to content

Commit 748a2a2

Browse files
natebiggsCommit Queue
authored andcommitted
[dart2js] Fix handling of flags for proto mixin shaking.
Sets `enableProtoShaking` earlier based on the mixin flag. For sequential builds that emit a dill file during the closed world phase, the output file name was not being set correctly becasue this flag was not updated early enough. Change-Id: I079559c98d7e25841971bdf2e840a80355460e54 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/422347 Reviewed-by: Mayank Patke <[email protected]> Commit-Queue: Nate Biggs <[email protected]>
1 parent d49663a commit 748a2a2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/compiler/lib/src/options.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,9 @@ class CompilerOptions implements DiagnosticOptions {
934934
options,
935935
Flags.laxRuntimeTypeToString,
936936
)
937-
..enableProtoShaking = _hasOption(options, Flags.enableProtoShaking)
937+
..enableProtoShaking =
938+
_hasOption(options, Flags.enableProtoShaking) ||
939+
_hasOption(options, Flags.enableProtoMixinShaking)
938940
..enableProtoMixinShaking = _hasOption(
939941
options,
940942
Flags.enableProtoMixinShaking,
@@ -1062,6 +1064,8 @@ class CompilerOptions implements DiagnosticOptions {
10621064
}
10631065
}
10641066

1067+
// This should only be used to derive options to be used during compilation,
1068+
// not for options needed during set up of the compiler.
10651069
void deriveOptions() {
10661070
if (benchmarkingProduction) {
10671071
trustPrimitives = true;
@@ -1145,10 +1149,6 @@ class CompilerOptions implements DiagnosticOptions {
11451149
mergeFragmentsThreshold = _mergeFragmentsThreshold;
11461150
}
11471151

1148-
if (enableProtoMixinShaking) {
1149-
enableProtoShaking = true;
1150-
}
1151-
11521152
environment['dart.web.assertions_enabled'] = '$enableUserAssertions';
11531153
environment['dart.tool.dart2js'] = '${true}';
11541154
environment['dart.tool.dart2js.minify'] = '$enableMinification';

0 commit comments

Comments
 (0)