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

Commit 4c4bf41

Browse files
author
Dart CI
committed
Version 2.15.0-51.0.dev
Merge commit '0231a0841a37ab2abfe9c236258f67f9f1bfa4fe' into 'dev'
2 parents 35c81c5 + 0231a08 commit 4c4bf41

File tree

20 files changed

+326
-103
lines changed

20 files changed

+326
-103
lines changed

benchmarks/EventLoopLatencyRegexp/dart2/EventLoopLatencyRegexp.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
import 'dart:isolate';
88

9-
import 'json_benchmark.dart';
9+
import 'regexp_benchmark.dart';
1010
import 'latency.dart';
1111

1212
main() async {

pkg/analysis_server/tool/code_completion/completion_metrics.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,8 +1071,9 @@ class CompletionMetricsComputer {
10711071
.toList();
10721072
locations.sort();
10731073
for (var location in locations) {
1074-
table.add(toRow(targetMetrics
1075-
.map((metrics) => metrics.locationMrrComputers[location]!)));
1074+
table.add(toRow(targetMetrics.map((metrics) =>
1075+
metrics.locationMrrComputers[location] ??
1076+
MeanReciprocalRankComputer(location))));
10761077
}
10771078
}
10781079
rightJustifyColumns(table, range(1, table[0].length));

pkg/analyzer/lib/src/generated/resolver.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1701,9 +1701,9 @@ class ResolverVisitor extends ResolverBase with ErrorDetectionHelpers {
17011701

17021702
var functionRewrite = MethodInvocationResolver.getRewriteResult(node);
17031703
if (functionRewrite != null) {
1704-
nullShortingTermination(node, discardType: true);
17051704
_resolveRewrittenFunctionExpressionInvocation(
17061705
functionRewrite, whyNotPromotedList);
1706+
nullShortingTermination(node, discardType: true);
17071707
} else {
17081708
nullShortingTermination(node);
17091709
}

pkg/analyzer/test/src/dart/resolution/method_invocation_test.dart

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2542,6 +2542,34 @@ void testShort(C? c) {
25422542
);
25432543
}
25442544

2545+
test_hasReceiver_interfaceQ_nullShorting_getter() async {
2546+
await assertNoErrorsInCode(r'''
2547+
abstract class C {
2548+
void Function(C) get foo;
2549+
}
2550+
2551+
void f(C? c) {
2552+
c?.foo(c); // 1
2553+
}
2554+
''');
2555+
2556+
var invocation = findNode.functionExpressionInvocation('foo(c);');
2557+
assertElementNull(invocation);
2558+
assertInvokeType(invocation, 'void Function(C)');
2559+
assertType(invocation, 'void');
2560+
2561+
var foo = invocation.function as PropertyAccess;
2562+
assertType(foo, 'void Function(C)');
2563+
assertElement(foo.propertyName, findElement.getter('foo'));
2564+
assertType(foo.propertyName, 'void Function(C)');
2565+
2566+
assertSimpleIdentifier(
2567+
findNode.simple('c); // 1'),
2568+
element: findElement.parameter('c'),
2569+
type: 'C',
2570+
);
2571+
}
2572+
25452573
test_hasReceiver_interfaceTypeQ_defined() async {
25462574
await assertErrorsInCode(r'''
25472575
class A {

pkg/vm_snapshot_analysis/test/utils.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import 'package:test/test.dart';
1010

1111
final dartCompile = () {
1212
final sdkBin = path.dirname(Platform.executable);
13-
final dartCmd = path.join(sdkBin, Platform.isWindows ? 'dart.bat' : 'dart');
13+
final dartCmd = path.join(sdkBin, Platform.isWindows ? 'dart.exe' : 'dart');
1414

1515
if (!File(dartCmd).existsSync()) {
1616
throw 'Failed to locate `dart` in the SDK';
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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 file.
4+
// VMOptions=--verbose-debug
5+
6+
import 'package:observatory/service_io.dart';
7+
import 'package:test/test.dart';
8+
import 'service_test_common.dart';
9+
import 'test_helper.dart';
10+
11+
// DO NOT REORDER BEYOND THIS POINT
12+
bool testing = false;
13+
void printSync() {
14+
print('sync');
15+
if (testing) {
16+
// We'll never reach this code, but setting a breakpoint here will result in
17+
// the breakpoint being resolved below at line 25.
18+
print('unreachable'); // line 18, bp1
19+
}
20+
}
21+
22+
printSyncStar() sync* {
23+
// We'll end up resolving breakpoint 1 to this location instead of at line 15
24+
// if #46419 regresses.
25+
print('sync*');
26+
}
27+
28+
testeeDo() {
29+
printSync();
30+
final iterator = printSyncStar();
31+
32+
print('middle'); // Line 32, bp2
33+
34+
iterator.toList();
35+
}
36+
// END DO NOT REORDER SECTION
37+
38+
late Breakpoint bp1;
39+
late Breakpoint bp2;
40+
41+
final tests = <IsolateTest>[
42+
hasPausedAtStart,
43+
(Isolate isolate) async {
44+
await isolate.rootLibrary.load();
45+
final script = isolate.rootLibrary.scripts[0];
46+
47+
bp1 = await isolate.addBreakpoint(script, 18);
48+
print("BP1 - $bp1");
49+
expect(bp1, isNotNull);
50+
expect(bp1 is Breakpoint, isTrue);
51+
bp2 = await isolate.addBreakpoint(script, 32);
52+
print("BP2 - $bp2");
53+
expect(bp2, isNotNull);
54+
},
55+
resumeIsolate,
56+
(Isolate isolate) async {
57+
final stream = await isolate.vm.getEventStream(VM.kDebugStream);
58+
await for (ServiceEvent event in stream) {
59+
if (event.kind == ServiceEvent.kPauseBreakpoint) {
60+
var bp = event.breakpoint;
61+
print('Hit $bp');
62+
expect(bp, bp2);
63+
await isolate.resume();
64+
break;
65+
}
66+
}
67+
}
68+
];
69+
70+
void main([args = const []]) => runIsolateTests(
71+
args,
72+
tests,
73+
testeeConcurrent: testeeDo,
74+
pause_on_start: true,
75+
);

runtime/observatory/tests/service/service_kernel.status

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ positive_token_pos_test: SkipByDesign # Debugger is disabled in AOT mode.
163163
regress_28443_test: SkipByDesign # Debugger is disabled in AOT mode.
164164
regress_28980_test: SkipByDesign # Debugger is disabled in AOT mode.
165165
regress_34841_test: SkipByDesign # Debugger is disabled in AOT mode.
166+
regress_46419_test: SkipByDesign # Debugger is disabled in AOT mode.
166167
reload_sources_test: SkipByDesign # Hot reload is disabled in AOT mode.
167168
rewind_optimized_out_test: SkipByDesign # Debugger is disabled in AOT mode.
168169
rewind_test: SkipByDesign # Debugger is disabled in AOT mode.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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 file.
4+
// VMOptions=--verbose-debug
5+
6+
import 'package:observatory_2/service_io.dart';
7+
import 'package:test/test.dart';
8+
import 'service_test_common.dart';
9+
import 'test_helper.dart';
10+
11+
// DO NOT REORDER BEYOND THIS POINT
12+
bool testing = false;
13+
void printSync() {
14+
print('sync');
15+
if (testing) {
16+
// We'll never reach this code, but setting a breakpoint here will result in
17+
// the breakpoint being resolved below at line 25.
18+
print('unreachable'); // line 18, bp1
19+
}
20+
}
21+
22+
printSyncStar() sync* {
23+
// We'll end up resolving breakpoint 1 to this location instead of at line 15
24+
// if #46419 regresses.
25+
print('sync*');
26+
}
27+
28+
testeeDo() {
29+
printSync();
30+
final iterator = printSyncStar();
31+
32+
print('middle'); // Line 32, bp2
33+
34+
iterator.toList();
35+
}
36+
// END DO NOT REORDER SECTION
37+
38+
Breakpoint bp1;
39+
Breakpoint bp2;
40+
41+
final tests = <IsolateTest>[
42+
hasPausedAtStart,
43+
(Isolate isolate) async {
44+
await isolate.rootLibrary.load();
45+
final script = isolate.rootLibrary.scripts[0];
46+
47+
bp1 = await isolate.addBreakpoint(script, 18);
48+
print("BP1 - $bp1");
49+
expect(bp1, isNotNull);
50+
expect(bp1 is Breakpoint, isTrue);
51+
bp2 = await isolate.addBreakpoint(script, 32);
52+
print("BP2 - $bp2");
53+
expect(bp2, isNotNull);
54+
},
55+
resumeIsolate,
56+
(Isolate isolate) async {
57+
final stream = await isolate.vm.getEventStream(VM.kDebugStream);
58+
await for (ServiceEvent event in stream) {
59+
if (event.kind == ServiceEvent.kPauseBreakpoint) {
60+
var bp = event.breakpoint;
61+
print('Hit $bp');
62+
expect(bp, bp2);
63+
await isolate.resume();
64+
break;
65+
}
66+
}
67+
}
68+
];
69+
70+
void main([args = const []]) => runIsolateTests(
71+
args,
72+
tests,
73+
testeeConcurrent: testeeDo,
74+
pause_on_start: true,
75+
);

runtime/observatory_2/tests/service_2/service_2_kernel.status

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ positive_token_pos_test: SkipByDesign # Debugger is disabled in AOT mode.
163163
regress_28443_test: SkipByDesign # Debugger is disabled in AOT mode.
164164
regress_28980_test: SkipByDesign # Debugger is disabled in AOT mode.
165165
regress_34841_test: SkipByDesign # Debugger is disabled in AOT mode.
166+
regress_46419_test: SkipByDesign # Debugger is disabled in AOT mode.
166167
reload_sources_test: SkipByDesign # Hot reload is disabled in AOT mode.
167168
rewind_optimized_out_test: SkipByDesign # Debugger is disabled in AOT mode.
168169
rewind_test: SkipByDesign # Debugger is disabled in AOT mode.

runtime/vm/class_finalizer.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1381,6 +1381,7 @@ void ClassFinalizer::VerifyImplicitFieldOffsets() {
13811381

13821382
void ClassFinalizer::SortClasses() {
13831383
auto T = Thread::Current();
1384+
StackZone stack_zone(T);
13841385
auto Z = T->zone();
13851386
auto IG = T->isolate_group();
13861387

0 commit comments

Comments
 (0)