Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Manual roll of Dart SDK from ce76503f5b46 to dcd5a8f005a #22766

Merged
merged 3 commits into from
Nov 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ vars = {
# Dart is: https://github.com/dart-lang/sdk/blob/master/DEPS.
# You can use //tools/dart/create_updated_flutter_deps.py to produce
# updated revision list of existing dependencies.
'dart_revision': 'ce76503f5b461590926ba619351518d593b81153',
'dart_revision': 'dcd5a8f005a27361f351ef12b2ad49e700d36169',

# WARNING: DO NOT EDIT MANUALLY
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py
Expand Down
2 changes: 1 addition & 1 deletion ci/licenses_golden/licenses_third_party
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Signature: e4f965835a37a079ac9033d7fe951bb4
Signature: 32a07d90ab604d3cd5828941c268ea0d

UNUSED LICENSES:

Expand Down
8 changes: 7 additions & 1 deletion tools/const_finder/.dart_tool/package_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@
"packageUri": "lib",
"languageVersion": "2.4"
},
{
"name": "collection",
"rootUri": "../../../../third_party/dart/third_party/pkg/collection",
"packageUri": "lib",
"languageVersion": "2.10"
},
{
"name": "kernel",
"rootUri": "../../../../third_party/dart/pkg/kernel",
Expand All @@ -32,4 +38,4 @@
"languageVersion": "2.10"
}
]
}
}
3 changes: 2 additions & 1 deletion tools/const_finder/.packages
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Generated by pub on 2020-07-16 10:06:29.401548.
# Generated by pub on 2020-11-27 10:12:47.813477.
args:../../../third_party/dart/third_party/pkg/args/lib/
collection:../../../third_party/dart/third_party/pkg/collection/lib/
kernel:../../../third_party/dart/pkg/kernel/lib/
meta:../../../third_party/dart/pkg/meta/lib/
path:../../../third_party/dart/third_party/pkg/path/lib/
Expand Down
3 changes: 3 additions & 0 deletions tools/const_finder/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ environment:

dependencies:
args: any
collection: any
meta: any
kernel: any

Expand All @@ -27,6 +28,8 @@ dev_dependencies:
dependency_overrides:
args:
path: ../../../third_party/dart/third_party/pkg/args
collection:
path: ../../../third_party/dart/third_party/pkg/collection
kernel:
path: ../../../third_party/dart/pkg/kernel
meta:
Expand Down
41 changes: 29 additions & 12 deletions tools/const_finder/test/const_finder_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import 'dart:convert' show jsonEncode;
import 'dart:io';

import 'package:collection/collection.dart';
import 'package:const_finder/const_finder.dart';
import 'package:path/path.dart' as path;

Expand All @@ -16,6 +17,22 @@ void expect<T>(T value, T expected) {
}
}

void expectInstances(dynamic value, dynamic expected) {
// To ensure we ignore insertion order into maps as well as lists we use
// DeepCollectionEquality as well as sort the lists.

int compareByStringValue(dynamic a, dynamic b) {
return a['stringValue'].compareTo(b['stringValue']) as int;
}
value['constantInstances'].sort(compareByStringValue);
expected['constantInstances'].sort(compareByStringValue);
if (!const DeepCollectionEquality().equals(value, expected)) {
stderr.writeln('Expected: ${jsonEncode(expected)}');
stderr.writeln('Actual: ${jsonEncode(value)}');
exitCode = -1;
}
}

final String basePath =
path.canonicalize(path.join(path.dirname(Platform.script.path), '..'));
final String fixtures = path.join(basePath, 'test', 'fixtures');
Expand Down Expand Up @@ -50,9 +67,9 @@ void _checkConsts() {
classLibraryUri: 'package:const_finder_fixtures/target.dart',
className: 'Target',
);
expect<String>(
jsonEncode(finder.findInstances()),
jsonEncode(<String, dynamic>{
expectInstances(
finder.findInstances(),
<String, dynamic>{
'constantInstances': <Map<String, dynamic>>[
<String, dynamic>{'stringValue': '100', 'intValue': 100, 'targetValue': null},
<String, dynamic>{'stringValue': '102', 'intValue': 102, 'targetValue': null},
Expand All @@ -76,22 +93,22 @@ void _checkConsts() {
<String, dynamic>{'stringValue': 'package', 'intValue':-1, 'targetValue': null},
],
'nonConstantLocations': <dynamic>[],
}),
},
);

final ConstFinder finder2 = ConstFinder(
kernelFilePath: constsDill,
classLibraryUri: 'package:const_finder_fixtures/target.dart',
className: 'MixedInTarget',
);
expect<String>(
jsonEncode(finder2.findInstances()),
jsonEncode(<String, dynamic>{
expectInstances(
finder2.findInstances(),
<String, dynamic>{
'constantInstances': <Map<String, dynamic>>[
<String, dynamic>{'val': '13'},
],
'nonConstantLocations': <dynamic>[],
}),
},
);
}

Expand All @@ -103,9 +120,9 @@ void _checkNonConsts() {
className: 'Target',
);

expect<String>(
jsonEncode(finder.findInstances()),
jsonEncode(<String, dynamic>{
expectInstances(
finder.findInstances(),
<String, dynamic>{
'constantInstances': <dynamic>[
<String, dynamic>{'stringValue': '1', 'intValue': 1, 'targetValue': null},
<String, dynamic>{'stringValue': '6', 'intValue': 6, 'targetValue': null},
Expand Down Expand Up @@ -141,7 +158,7 @@ void _checkNonConsts() {
'column': 25,
}
]
}),
},
);
}

Expand Down