Skip to content

Commit 00a9662

Browse files
author
Dart CI
committed
Version 2.18.0-113.0.dev
Merge commit '44f85834256ea00ebad401b54934f18028ff3101' into 'dev'
2 parents 472c09f + 44f8583 commit 00a9662

File tree

16 files changed

+146
-939
lines changed

16 files changed

+146
-939
lines changed

pkg/dev_compiler/lib/src/kernel/type_table.dart

+9-10
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// @dart = 2.9
6-
75
import 'dart:collection';
86

97
import 'package:kernel/kernel.dart';
@@ -55,7 +53,7 @@ String _typeString(DartType type, {bool flat = false}) {
5553
if (type is InterfaceType) {
5654
var name = '${type.classNode.name}$nullability';
5755
var typeArgs = type.typeArguments;
58-
if (typeArgs == null) return name;
56+
if (typeArgs.isEmpty) return name;
5957
if (typeArgs.every((p) => p == const DynamicType())) return name;
6058
return "${name}Of${typeArgs.map(_typeString).join("\$")}";
6159
}
@@ -67,7 +65,7 @@ String _typeString(DartType type, {bool flat = false}) {
6765
if (type is TypedefType) {
6866
var name = '${type.typedefNode.name}$nullability';
6967
var typeArgs = type.typeArguments;
70-
if (typeArgs == null) return name;
68+
if (typeArgs.isEmpty) return name;
7169
if (typeArgs.every((p) => p == const DynamicType())) return name;
7270
return "${name}Of${typeArgs.map(_typeString).join("\$")}";
7371
}
@@ -110,7 +108,7 @@ class TypeTable {
110108

111109
/// Holds JS type generators keyed by their underlying DartType.
112110
final typeContainer = ModuleItemContainer<DartType>.asObject('T',
113-
keyToString: (DartType t) => escapeIdentifier(_typeString(t)));
111+
keyToString: (DartType t) => escapeIdentifier(_typeString(t))!);
114112

115113
final js_ast.Expression Function(String, [List<Object>]) _runtimeCall;
116114

@@ -151,8 +149,8 @@ class TypeTable {
151149

152150
js_ast.Statement _dischargeFreeType(DartType type) {
153151
typeContainer.setNoEmit(type);
154-
var init = typeContainer[type];
155-
var id = _unboundTypeIds[type];
152+
var init = typeContainer[type]!;
153+
var id = _unboundTypeIds[type]!;
156154
// TODO(vsm): Change back to `let`.
157155
// See https://github.com/dart-lang/sdk/issues/40380.
158156
return js.statement('var # = () => ((# = #)());', [
@@ -167,15 +165,16 @@ class TypeTable {
167165
///
168166
/// If [formals] is present, only emit the definitions which depend on the
169167
/// formals.
170-
List<js_ast.Statement> dischargeFreeTypes([Iterable<TypeParameter> formals]) {
168+
List<js_ast.Statement> dischargeFreeTypes(
169+
[Iterable<TypeParameter>? formals]) {
171170
var decls = <js_ast.Statement>[];
172171
var types = formals == null
173172
? typeContainer.keys.where((p) => freeTypeParameters(p).isNotEmpty)
174173
: formals.expand((p) => _scopeDependencies[p] ?? <DartType>[]).toSet();
175174

176175
for (var t in types) {
177176
var stmt = _dischargeFreeType(t);
178-
if (stmt != null) decls.add(stmt);
177+
decls.add(stmt);
179178
}
180179
return decls;
181180
}
@@ -221,7 +220,7 @@ class TypeTable {
221220
// TODO(40273) Remove prepended text when we have a better way to hide
222221
// these names from debug tools.
223222
_unboundTypeIds[type] =
224-
js_ast.TemporaryId(escapeIdentifier('__t\$${_typeString(type)}'));
223+
js_ast.TemporaryId(escapeIdentifier('__t\$${_typeString(type)}')!);
225224
}
226225

227226
for (var free in freeVariables) {

pkg/dev_compiler/test/modular_suite.dart

+6-10
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// @dart = 2.9
6-
75
/// Test the modular compilation pipeline of ddc.
86
///
97
/// This is a shell that runs multiple tests, one per folder under `data/`.
@@ -18,9 +16,9 @@ import 'package:modular_test/src/suite.dart';
1816
String packageConfigJsonPath = '.dart_tool/package_config.json';
1917
Uri sdkRoot = Platform.script.resolve('../../../');
2018
Uri packageConfigUri = sdkRoot.resolve(packageConfigJsonPath);
21-
Options _options;
22-
String _dartdevcScript;
23-
String _kernelWorkerScript;
19+
late Options _options;
20+
late String _dartdevcScript;
21+
late String _kernelWorkerScript;
2422

2523
void main(List<String> args) async {
2624
_options = Options.parse(args);
@@ -89,8 +87,7 @@ class SourceToSummaryDillStep implements IOModularStep {
8987
extraArgs = [
9088
'--libraries-file',
9189
'$rootScheme:///sdk/lib/libraries.json',
92-
'--enable-experiment',
93-
'non-nullable',
90+
'--no-sound-null-safety',
9491
];
9592
assert(transitiveDependencies.isEmpty);
9693
} else {
@@ -175,8 +172,7 @@ class DDCStep implements IOModularStep {
175172
'--compile-sdk',
176173
'--libraries-file',
177174
'$rootScheme:///sdk/lib/libraries.json',
178-
'--enable-experiment',
179-
'non-nullable',
175+
'--no-sound-null-safety',
180176
];
181177
assert(transitiveDependencies.isEmpty);
182178
} else {
@@ -319,7 +315,7 @@ String get _d8executable {
319315

320316
String _sourceToImportUri(Module module, String rootScheme, Uri relativeUri) {
321317
if (module.isPackage) {
322-
var basePath = module.packageBase.path;
318+
var basePath = module.packageBase!.path;
323319
var packageRelativePath = basePath == './'
324320
? relativeUri.path
325321
: relativeUri.path.substring(basePath.length);

pkg/dev_compiler/test/modular_suite_nnbd.dart

+6-14
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5-
// @dart = 2.9
6-
75
/// Test the modular compilation pipeline of ddc.
86
///
97
/// This is a shell that runs multiple tests, one per folder under `data/`.
@@ -18,9 +16,9 @@ import 'package:modular_test/src/suite.dart';
1816
String packageConfigJsonPath = '.dart_tool/package_config.json';
1917
Uri sdkRoot = Platform.script.resolve('../../../');
2018
Uri packageConfigUri = sdkRoot.resolve(packageConfigJsonPath);
21-
Options _options;
22-
String _dartdevcScript;
23-
String _kernelWorkerScript;
19+
late Options _options;
20+
late String _dartdevcScript;
21+
late String _kernelWorkerScript;
2422

2523
void main(List<String> args) async {
2624
_options = Options.parse(args);
@@ -120,10 +118,7 @@ class SourceToSummaryDillStep implements IOModularStep {
120118
.where((m) => !m.isSdk)
121119
.expand((m) => ['--input-summary', '${toUri(m, dillId)}']),
122120
...sources.expand((String uri) => ['--source', uri]),
123-
// TODO(40266) After unfork of dart:_runtime only need experiment when
124-
// compiling SDK. For now always use the Null Safety experiment.
125-
'--enable-experiment',
126-
'non-nullable',
121+
'--sound-null-safety',
127122
...flags.expand((String flag) => ['--enable-experiment', flag]),
128123
];
129124

@@ -206,10 +201,7 @@ class DDCStep implements IOModularStep {
206201
rootScheme,
207202
...sources,
208203
...extraArgs,
209-
// TODO(40266) After unfork of dart:_runtime only need experiment when
210-
// compiling SDK. For now always use the Null Safety experiment.
211-
'--enable-experiment',
212-
'non-nullable',
204+
'--sound-null-safety',
213205
for (String flag in flags) '--enable-experiment=$flag',
214206
...transitiveDependencies
215207
.where((m) => !m.isSdk)
@@ -323,7 +315,7 @@ String get _d8executable {
323315

324316
String _sourceToImportUri(Module module, String rootScheme, Uri relativeUri) {
325317
if (module.isPackage) {
326-
var basePath = module.packageBase.path;
318+
var basePath = module.packageBase!.path;
327319
var packageRelativePath = basePath == './'
328320
? relativeUri.path
329321
: relativeUri.path.substring(basePath.length);

pkg/test_runner/bin/http_server.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
// for details. All rights reserved. Use of this source code is governed by a
33
// BSD-style license that can be found in the LICENSE file.
44

5+
import 'package:args/args.dart';
56
import 'package:test_runner/src/configuration.dart';
67
import 'package:test_runner/src/testing_servers.dart';
78
import 'package:test_runner/src/utils.dart';
8-
import 'package:test_runner/src/vendored_pkg/args/args.dart';
99

1010
void main(List<String> arguments) {
1111
var parser = ArgParser();
@@ -30,7 +30,7 @@ void main(List<String> arguments) {
3030

3131
var args = parser.parse(arguments);
3232
if (args['help'] as bool) {
33-
print(parser.getUsage());
33+
print(parser.usage);
3434
} else {
3535
var servers = TestingServers(
3636
args['build-directory'] as String,

pkg/test_runner/lib/src/vendored_pkg/README.txt

-4
This file was deleted.

0 commit comments

Comments
 (0)