Skip to content

Commit d3b988f

Browse files
natebiggsCommit Queue
authored andcommitted
Remove dot shorthand syntax from SDK libraries.
Bug: #61856 CoreLibraryReviewExempt: no functional changes, reverting to older syntax. Change-Id: Iad4b8ea420fc4ca02403aa73bcf542064435ae02 Tested: Ran flutter try bot Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/458420 Commit-Queue: Nate Biggs <[email protected]> Reviewed-by: Slava Egorov <[email protected]>
1 parent 2608c03 commit d3b988f

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

sdk/lib/_internal/vm/lib/developer.dart

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,10 @@ abstract final class NativeRuntime {
235235
static void streamTimelineTo(
236236
TimelineRecorder recorder, {
237237
String? path,
238-
List<TimelineStream> streams = const [.dart, .gc],
238+
List<TimelineStream> streams = const [
239+
TimelineStream.dart,
240+
TimelineStream.gc,
241+
],
239242
bool enableProfiler = false,
240243
Duration samplingInterval = const Duration(microseconds: 1000),
241244
}) {
@@ -247,7 +250,7 @@ abstract final class NativeRuntime {
247250
);
248251
}
249252

250-
if (recorder == .systrace) {
253+
if (recorder == TimelineRecorder.systrace) {
251254
if (path != null) {
252255
throw ArgumentError.value(
253256
path,
@@ -266,15 +269,15 @@ abstract final class NativeRuntime {
266269
}
267270
}
268271

269-
if (recorder != .systrace && path == null) {
272+
if (recorder != TimelineRecorder.systrace && path == null) {
270273
throw ArgumentError.value(
271274
path,
272275
'path',
273276
'$recorder needs an output file to write timeline data to',
274277
);
275278
}
276279

277-
if (recorder != .perfetto && enableProfiler) {
280+
if (recorder != TimelineRecorder.perfetto && enableProfiler) {
278281
throw ArgumentError.value(
279282
enableProfiler,
280283
'enableProfiler',
@@ -284,25 +287,25 @@ abstract final class NativeRuntime {
284287
}
285288

286289
final recorderName = switch (recorder) {
287-
.perfetto => 'perfettofile',
288-
.chrome => 'file',
289-
.systrace => 'systrace',
290+
TimelineRecorder.perfetto => 'perfettofile',
291+
TimelineRecorder.chrome => 'file',
292+
TimelineRecorder.systrace => 'systrace',
290293
};
291294

292295
// Convert list of TimelineStream into a comma-separated list of values.
293296
final streamsString = [
294297
for (var str in streams)
295298
switch (str) {
296-
.api => 'API',
297-
.compiler => 'Compiler',
298-
.compilerVerbose => 'CompilerVerbose',
299-
.dart => 'Dart',
300-
.debugger => 'Debugger',
301-
.embedder => 'Embedder',
302-
.gc => 'GC',
303-
.isolate => 'Isolate',
304-
.microtask => 'Microtask',
305-
.vm => 'vm',
299+
TimelineStream.api => 'API',
300+
TimelineStream.compiler => 'Compiler',
301+
TimelineStream.compilerVerbose => 'CompilerVerbose',
302+
TimelineStream.dart => 'Dart',
303+
TimelineStream.debugger => 'Debugger',
304+
TimelineStream.embedder => 'Embedder',
305+
TimelineStream.gc => 'GC',
306+
TimelineStream.isolate => 'Isolate',
307+
TimelineStream.microtask => 'Microtask',
308+
TimelineStream.vm => 'vm',
306309
},
307310
].join(',');
308311

sdk/lib/developer/developer.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,10 @@ abstract final class NativeRuntime {
267267
external static void streamTimelineTo(
268268
TimelineRecorder recorder, {
269269
String? path,
270-
List<TimelineStream> streams = const [.dart, .gc],
270+
List<TimelineStream> streams = const [
271+
TimelineStream.dart,
272+
TimelineStream.gc,
273+
],
271274
bool enableProfiler = false,
272275
Duration samplingInterval = const Duration(microseconds: 1000),
273276
});

0 commit comments

Comments
 (0)