Skip to content

Commit 3df2adc

Browse files
fishythefishCommit Queue
authored andcommitted
[dart2js] Add failing tests for #49599, #55058, #60115.
Bug: #49599 Bug: #55058 Bug: #60115 Change-Id: I5e7022179a0d64b92304aec31a5732bb4b00db16 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/258960 Reviewed-by: Stephen Adams <[email protected]>
1 parent 4d8b468 commit 3df2adc

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) 2025, 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+
5+
// dart2jsOptions=--disable-type-inference
6+
7+
import 'package:expect/expect.dart';
8+
9+
void main() {
10+
final foo = Foo();
11+
final bar = foo.mapLookup('a');
12+
Expect.equals('c', bar);
13+
}
14+
15+
class Foo {
16+
late var lateMap = <String, String>{};
17+
18+
String mapLookup(String key) {
19+
return lateMap.putIfAbsent(key, () => 'c');
20+
}
21+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Copyright (c) 2025, 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+
5+
// dart2jsOptions=--disable-type-inference
6+
7+
import 'package:expect/expect.dart';
8+
9+
void main() {
10+
var uri = Uri.parse('https://[email protected]/pathsegment');
11+
Expect.isFalse(uri.pathSegments.isEmpty);
12+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright (c) 2025, 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+
5+
// dart2jsOptions=--disable-type-inference
6+
7+
import 'package:expect/expect.dart';
8+
9+
void main() {
10+
final foo = Foo();
11+
Expect.equals('foo', foo.name);
12+
}
13+
14+
final class Foo {
15+
late final String name = 'foo';
16+
}

0 commit comments

Comments
 (0)