@@ -25,6 +25,8 @@ import 'file_system.dart' show FileSystem;
25
25
26
26
import 'standard_file_system.dart' show StandardFileSystem;
27
27
28
+ import '../api_unstable/util.dart' ;
29
+
28
30
export 'package:_fe_analyzer_shared/src/messages/diagnostic_message.dart'
29
31
show DiagnosticMessage;
30
32
@@ -102,7 +104,7 @@ class CompilerOptions {
102
104
/// When this option is `true` , [sdkSummary] must be null.
103
105
bool compileSdk = false ;
104
106
105
- @deprecated
107
+ @Deprecated ( "Unused internally." )
106
108
bool chaseDependencies;
107
109
108
110
/// Patch files to apply on the core libraries for a specific target platform.
@@ -119,6 +121,7 @@ class CompilerOptions {
119
121
/// directly, while relative URIs are resolved from the [sdkRoot] .
120
122
// TODO(sigmund): provide also a flag to load this data from a file (like
121
123
// libraries.json)
124
+ @Deprecated ("Unused internally." )
122
125
Map <String , List <Uri >> targetPatches = < String , List <Uri >> {};
123
126
124
127
/// Enable or disable experimental features. Features mapping to `true` are
@@ -153,6 +156,7 @@ class CompilerOptions {
153
156
154
157
/// Deprecated. Has no affect on front-end.
155
158
// TODO(dartbug.com/37514) Remove this field once DDK removes its uses of it.
159
+ @Deprecated ("Unused internally." )
156
160
bool enableAsserts = false ;
157
161
158
162
/// Whether to show verbose messages (mainly for debugging and performance
@@ -232,6 +236,65 @@ class CompilerOptions {
232
236
String currentSdkVersion = "${kernel .defaultLanguageVersionMajor }"
233
237
"."
234
238
"${kernel .defaultLanguageVersionMinor }" ;
239
+
240
+ bool equivalent (CompilerOptions other,
241
+ {bool ignoreOnDiagnostic: true ,
242
+ bool ignoreVerbose: true ,
243
+ bool ignoreVerify: true ,
244
+ bool ignoreDebugDump: true }) {
245
+ if (sdkRoot != other.sdkRoot) return false ;
246
+ if (librariesSpecificationUri != other.librariesSpecificationUri) {
247
+ return false ;
248
+ }
249
+ if (! ignoreOnDiagnostic) {
250
+ if (onDiagnostic != other.onDiagnostic) return false ;
251
+ }
252
+ if (packagesFileUri != other.packagesFileUri) return false ;
253
+ if (! equalLists (additionalDills, other.additionalDills)) return false ;
254
+ if (sdkSummary != other.sdkSummary) return false ;
255
+ if (! equalMaps (declaredVariables, other.declaredVariables)) return false ;
256
+ if (fileSystem != other.fileSystem) return false ;
257
+ if (compileSdk != compileSdk) return false ;
258
+ // chaseDependencies aren't used anywhere, so ignored here.
259
+ // targetPatches aren't used anywhere, so ignored here.
260
+ if (! equalMaps (experimentalFlags, other.experimentalFlags)) return false ;
261
+ if (! equalMaps (environmentDefines, other.environmentDefines)) return false ;
262
+ if (errorOnUnevaluatedConstant != other.errorOnUnevaluatedConstant) {
263
+ return false ;
264
+ }
265
+ if (target != other.target) {
266
+ if (target.runtimeType != other.target.runtimeType) return false ;
267
+ if (target.name != other.target.name) return false ;
268
+ if (target.flags != other.target.flags) return false ;
269
+ }
270
+ // enableAsserts is not used anywhere, so ignored here.
271
+ if (! ignoreVerbose) {
272
+ if (verbose != other.verbose) return false ;
273
+ }
274
+ if (! ignoreVerify) {
275
+ if (verify != other.verify) return false ;
276
+ }
277
+ if (! ignoreDebugDump) {
278
+ if (debugDump != other.debugDump) return false ;
279
+ }
280
+ if (omitPlatform != other.omitPlatform) return false ;
281
+ if (setExitCodeOnProblem != other.setExitCodeOnProblem) return false ;
282
+ if (embedSourceText != other.embedSourceText) return false ;
283
+ if (throwOnErrorsForDebugging != other.throwOnErrorsForDebugging) {
284
+ return false ;
285
+ }
286
+ if (throwOnWarningsForDebugging != other.throwOnWarningsForDebugging) {
287
+ return false ;
288
+ }
289
+ if (skipForDebugging != other.skipForDebugging) return false ;
290
+ if (bytecode != other.bytecode) return false ;
291
+ if (writeFileOnCrashReport != other.writeFileOnCrashReport) return false ;
292
+ if (nnbdMode != other.nnbdMode) return false ;
293
+ if (performNnbdChecks != other.performNnbdChecks) return false ;
294
+ if (currentSdkVersion != other.currentSdkVersion) return false ;
295
+
296
+ return true ;
297
+ }
235
298
}
236
299
237
300
/// Parse experimental flag arguments of the form 'flag' or 'no-flag' into a map
0 commit comments