Skip to content

Commit 9e071c5

Browse files
derekxu16Commit Queue
authored and
Commit Queue
committed
[dartdev] Fix --resident option
The --enable-asserts option is not defined in PRODUCT mode, so args.wasParsed(enableAssertsOption) currently reports an error saying "Could not find an option named --enable-asserts". Change-Id: Ic3d0695fc608ccb674141dc5b918d0bdf3dc298e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/322422 Commit-Queue: Derek Xu <[email protected]> Reviewed-by: Ben Konyi <[email protected]>
1 parent c592600 commit 9e071c5

File tree

1 file changed

+3
-31
lines changed

1 file changed

+3
-31
lines changed

pkg/dartdev/lib/src/resident_frontend_utils.dart

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ String createCompileJitJson({
102102
sourceString: executable,
103103
outputString: outputDill,
104104
if (args.wasParsed(defineOption)) defineOption: args[defineOption],
105-
if (args.wasParsed(enableAssertsOption)) enableAssertsOption: true,
105+
if (args.options.contains(enableAssertsOption) &&
106+
args.wasParsed(enableAssertsOption))
107+
enableAssertsOption: true,
106108
if (args.wasParsed(enableExperimentOption))
107109
enableExperimentOption: args[enableExperimentOption]
108110
.map((e) => '--enable-experiment=$e')
@@ -113,33 +115,3 @@ String createCompileJitJson({
113115
},
114116
);
115117
}
116-
117-
/// Used to create compile requests for AOT compilations
118-
String createCompileAotJson({
119-
required String executable,
120-
required String outputDill,
121-
required ArgResults args,
122-
String? packages,
123-
bool productMode = false,
124-
bool verbose = false,
125-
}) {
126-
return jsonEncode(
127-
<String, Object?>{
128-
commandString: compileString,
129-
sourceString: executable,
130-
outputString: outputDill,
131-
aotOption: true,
132-
tfaOption: true,
133-
if (productMode) '-Ddart.vm.product': true,
134-
if (args.wasParsed(defineOption)) defineOption: args[defineOption],
135-
if (args.wasParsed(enableExperimentOption))
136-
enableExperimentOption: args[enableExperimentOption],
137-
if (args.wasParsed(packageString)) packageString: args[packageString],
138-
if (!args.wasParsed(packageString) && packages != null)
139-
packageString: packages,
140-
if (args.wasParsed(soundNullSafetyOption)) soundNullSafetyOption: true,
141-
if (args.wasParsed(verbosityOption))
142-
verbosityOption: args[verbosityOption],
143-
},
144-
);
145-
}

0 commit comments

Comments
 (0)