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

Commit a45eaf6

Browse files
author
Dart CI
committed
Version 2.14.0-60.0.dev
Merge commit 'b88a5d05f89b3b078baf6bfc63d6c74b48fe5bdf' into 'dev'
2 parents b5ff349 + b88a5d0 commit a45eaf6

11 files changed

+104
-13
lines changed

pkg/front_end/test/crashing_test_case_minimizer.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ main(List<String> arguments) async {
5858
settings.targetString = "flutter";
5959
} else if (arg.startsWith("--target=ddc")) {
6060
settings.targetString = "ddc";
61+
} else if (arg.startsWith("--target=dart2js")) {
62+
settings.targetString = "dart2js";
6163
} else if (arg == "--noTryToDeleteEmptyFilesUpFront") {
6264
settings.noTryToDeleteEmptyFilesUpFront = true;
6365
} else if (arg.startsWith("--wantErrorOnReload=")) {

pkg/front_end/test/crashing_test_case_minimizer_impl.dart

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ import 'package:_fe_analyzer_shared/src/scanner/scanner.dart'
2525

2626
import 'package:_fe_analyzer_shared/src/scanner/token.dart' show Token;
2727

28+
import 'package:compiler/src/kernel/dart2js_target.dart' show Dart2jsTarget;
29+
2830
import 'package:dev_compiler/src/kernel/target.dart' show DevCompilerTarget;
2931

3032
import 'package:front_end/src/api_prototype/compiler_options.dart'
@@ -1652,7 +1654,8 @@ worlds:
16521654
Uint8List candidate = builder.takeBytes();
16531655
if (candidate.length == data.length) return;
16541656

1655-
if (!_parsesWithoutError(candidate, _isUriNnbd(uri))) {
1657+
if (uri.path.endsWith(".dart") &&
1658+
!_parsesWithoutError(candidate, _isUriNnbd(uri))) {
16561659
print("WARNING: Parser error after stuff at ${StackTrace.current}");
16571660
}
16581661

@@ -1941,6 +1944,9 @@ worlds:
19411944
case "ddc":
19421945
target = new DevCompilerTarget(targetFlags);
19431946
break;
1947+
case "dart2js":
1948+
target = new Dart2jsTarget("dart2js", targetFlags);
1949+
break;
19441950
default:
19451951
throw "Unknown target '$target'";
19461952
}

pkg/front_end/test/incremental_suite.dart

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import 'package:_fe_analyzer_shared/src/util/colors.dart' as colors;
1515

1616
import 'package:_fe_analyzer_shared/src/messages/severity.dart' show Severity;
1717

18+
import 'package:compiler/src/kernel/dart2js_target.dart' show Dart2jsTarget;
19+
1820
import "package:dev_compiler/src/kernel/target.dart" show DevCompilerTarget;
1921

2022
import 'package:expect/expect.dart' show Expect;
@@ -32,7 +34,7 @@ import 'package:front_end/src/base/processed_options.dart'
3234
show ProcessedOptions;
3335

3436
import 'package:front_end/src/compute_platform_binaries_location.dart'
35-
show computePlatformBinariesLocation;
37+
show computePlatformBinariesLocation, computePlatformDillName;
3638

3739
import 'package:front_end/src/fasta/compiler_context.dart' show CompilerContext;
3840

@@ -213,7 +215,8 @@ class RunCompilations extends Step<TestData, TestData, Context> {
213215
"target",
214216
"forceLateLoweringForTesting",
215217
"trackWidgetCreation",
216-
"incrementalSerialization"
218+
"incrementalSerialization",
219+
"nnbdMode",
217220
]);
218221
result = await new NewWorldTest().newWorldTest(
219222
data,
@@ -225,6 +228,7 @@ class RunCompilations extends Step<TestData, TestData, Context> {
225228
map["forceLateLoweringForTesting"] ?? false,
226229
map["trackWidgetCreation"] ?? false,
227230
map["incrementalSerialization"],
231+
map["nnbdMode"] == "strong" ? NnbdMode.Strong : NnbdMode.Weak,
228232
);
229233
break;
230234
default:
@@ -390,28 +394,35 @@ class NewWorldTest {
390394
String targetName,
391395
bool forceLateLoweringForTesting,
392396
bool trackWidgetCreation,
393-
bool incrementalSerialization) async {
397+
bool incrementalSerialization,
398+
NnbdMode nnbdMode) async {
394399
final Uri sdkRoot = computePlatformBinariesLocation(forceBuildDir: true);
395400

396401
TargetFlags targetFlags = new TargetFlags(
397402
forceLateLoweringsForTesting:
398403
forceLateLoweringForTesting ? LateLowering.all : LateLowering.none,
399404
trackWidgetCreation: trackWidgetCreation);
400405
Target target = new VmTarget(targetFlags);
401-
String sdkSummary = "vm_platform_strong.dill";
402406
if (targetName != null) {
403407
if (targetName == "None") {
404408
target = new NoneTarget(targetFlags);
405409
} else if (targetName == "DDC") {
406410
target = new DevCompilerTarget(targetFlags);
407-
sdkSummary = "ddc_platform.dill";
411+
} else if (targetName == "dart2js") {
412+
target = new Dart2jsTarget("dart2js", targetFlags);
408413
} else if (targetName == "VM") {
409414
// default.
410415
} else {
411416
throw "Unknown target name '$targetName'";
412417
}
413418
}
414419

420+
String sdkSummary = computePlatformDillName(
421+
target,
422+
nnbdMode,
423+
() => throw new UnsupportedError(
424+
"No platform dill for target '${targetName}' with $nnbdMode."));
425+
415426
final Uri base = Uri.parse("org-dartlang-test:///");
416427
final Uri sdkSummaryUri = base.resolve(sdkSummary);
417428
final Uri initializeFrom = base.resolve("initializeFrom.dill");
@@ -525,6 +536,7 @@ class NewWorldTest {
525536

526537
if (brandNewWorld) {
527538
options = getOptions(target: target, sdkSummary: sdkSummary);
539+
options.nnbdMode = nnbdMode;
528540
options.fileSystem = fs;
529541
options.sdkRoot = null;
530542
options.sdkSummary = sdkSummaryUri;
@@ -549,6 +561,8 @@ class NewWorldTest {
549561
ExperimentalFlag.nonNullable: false
550562
};
551563
}
564+
// A separate "world" can also change nnbd mode ---
565+
// notice that the platform is not updated though!
552566
if (world["nnbdMode"] != null) {
553567
String nnbdMode = world["nnbdMode"];
554568
switch (nnbdMode) {

pkg/front_end/testcases/incremental/can_get_rid_of_nnbd_issue_error.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
# to get rid of it if the error is fixed.
77

88
type: newworld
9+
nnbdMode: strong
910
worlds:
1011
- entry: package:baz/main.dart
1112
experiments: non-nullable
12-
nnbdMode: strong
1313
errors: true
1414
sources:
1515
.dart_tool/package_config.json: |
@@ -54,7 +54,6 @@ worlds:
5454
# Update "nothing" so we still want the error.
5555
- entry: package:baz/main.dart
5656
experiments: non-nullable
57-
nnbdMode: strong
5857
worldType: updated
5958
expectInitializeFromDill: false
6059
errors: true
@@ -76,7 +75,6 @@ worlds:
7675
# Update ONE package to be strong.
7776
- entry: package:baz/main.dart
7877
experiments: non-nullable
79-
nnbdMode: strong
8078
worldType: updated
8179
expectInitializeFromDill: false
8280
errors: true
@@ -114,7 +112,6 @@ worlds:
114112
# Update the last package to be strong.
115113
- entry: package:baz/main.dart
116114
experiments: non-nullable
117-
nnbdMode: strong
118115
worldType: updated
119116
expectInitializeFromDill: false
120117
errors: false
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
2+
# for details. All rights reserved. Use of this source code is governed by a
3+
# BSD-style license that can be found in the LICENSE.md file.
4+
5+
# Reproduce a compilation failure: After invalidation it no longer compiles.
6+
# Dart2js doesn't really use the incremental compiler though.
7+
8+
type: newworld
9+
target: dart2js
10+
worlds:
11+
- entry: late_statics.dart
12+
experiments: non-nullable
13+
sources:
14+
late_statics.dart: |
15+
import 'late_statics_lib.dart' as lib;
16+
void testUninitializedNonFinalTopLevelField() {
17+
print(lib.a);
18+
lib.a = 42;
19+
print(lib.a);
20+
}
21+
late_statics_lib.dart: |
22+
late int a;
23+
expectedLibraryCount: 2
24+
25+
- entry: late_statics.dart
26+
worldType: updated
27+
errors: true # (currently?) dart2js changes the interface and doesn't have the setter anymore. dartbug.com/45854
28+
experiments: non-nullable
29+
expectInitializeFromDill: false
30+
invalidate:
31+
- late_statics.dart
32+
expectedLibraryCount: 2
33+
expectsRebuildBodiesOnly: false
34+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
main = <No Member>;
2+
library from "org-dartlang-test:///late_statics.dart" as lat {
3+
4+
import "org-dartlang-test:///late_statics_lib.dart" as lib;
5+
6+
static method testUninitializedNonFinalTopLevelField() → void {
7+
dart.core::print(lat2::a.{_late_helper::_Cell::readField}<dart.core::int>(){() → dart.core::int});
8+
lat2::a.{_late_helper::_Cell::value} = 42;
9+
dart.core::print(lat2::a.{_late_helper::_Cell::readField}<dart.core::int>(){() → dart.core::int});
10+
}
11+
}
12+
library from "org-dartlang-test:///late_statics_lib.dart" as lat2 {
13+
14+
static final field _late_helper::_Cell a = new _late_helper::_Cell::•();
15+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
main = <No Member>;
2+
library from "org-dartlang-test:///late_statics.dart" as lat {
3+
//
4+
// Problems in library:
5+
//
6+
// org-dartlang-test:///late_statics.dart:4:7: Error: Setter not found: 'a'.
7+
// lib.a = 42;
8+
// ^
9+
//
10+
11+
import "org-dartlang-test:///late_statics_lib.dart" as lib;
12+
13+
static method testUninitializedNonFinalTopLevelField() → void {
14+
dart.core::print(lat2::a);
15+
invalid-expression "org-dartlang-test:///late_statics.dart:4:7: Error: Setter not found: 'a'.\n lib.a = 42;\n ^";
16+
dart.core::print(lat2::a);
17+
}
18+
}
19+
library from "org-dartlang-test:///late_statics_lib.dart" as lat2 {
20+
21+
static final field _late_helper::_Cell a = new _late_helper::_Cell::•();
22+
}

pkg/front_end/testcases/incremental/issue_42323.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
# See https://github.com/dart-lang/sdk/issues/42323.
1010

1111
type: newworld
12+
nnbdMode: strong
1213
worlds:
1314
- entry: bin/runMe.dart
1415
experiments: non-nullable
15-
nnbdMode: strong
1616
enableStringReplacement: true
1717
sources:
1818
.dart_tool/package_config.json: |

pkg/front_end/testcases/incremental/issue_42323_prime.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
# Good "variant" of https://github.com/dart-lang/sdk/issues/42323.
1010

1111
type: newworld
12+
nnbdMode: strong
1213
worlds:
1314
- entry: bin/runMe.dart
1415
experiments: non-nullable
15-
nnbdMode: strong
1616
errors: true
1717
sources:
1818
.dart_tool/package_config.json: |

pkg/front_end/testcases/weak.status

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ general/error_recovery/issue_39058_prime.crash: SemiFuzzFailure
99
general/error_recovery/issue_39202.crash: SemiFuzzCrash
1010
general/error_recovery/issue_39058.crash: SemiFuzzFailure
1111
regress/utf_16_le_content.crash: SemiFuzzCrash
12+
dart2js/late_statics: SemiFuzzFailure # dartbug.com/45854
1213

1314
extension_types/extension_on_nullable: ExpectationFileMismatchSerialized # Expected.
1415
extension_types/issue45775: ExpectationFileMismatchSerialized # Expected.

0 commit comments

Comments
 (0)