| Index: test/codegen/corelib/list_first_test.dart
|
| diff --git a/test/codegen/language/interceptor3_test.dart b/test/codegen/corelib/list_first_test.dart
|
| similarity index 55%
|
| copy from test/codegen/language/interceptor3_test.dart
|
| copy to test/codegen/corelib/list_first_test.dart
|
| index a12172187ec342dba67ad1898a14b91c0aef9479..74be9812878727cc9af31296e7e8dbc2d3adfced 100644
|
| --- a/test/codegen/language/interceptor3_test.dart
|
| +++ b/test/codegen/corelib/list_first_test.dart
|
| @@ -4,14 +4,17 @@
|
|
|
| import "package:expect/expect.dart";
|
|
|
| -// Test that code motion in the presence of interceptors work in dart2js.
|
| -
|
| -main() {
|
| - var a = [2, '2'];
|
| - var b = a[1];
|
| - if (a[0] == 2 && b is String) {
|
| - Expect.isTrue(b.contains('2'));
|
| +void test(List list) {
|
| + if (list.isEmpty) {
|
| + Expect.throws(() => list.first, (e) => e is StateError);
|
| } else {
|
| - b.isEven();
|
| + Expect.equals(list[0], list.first);
|
| }
|
| }
|
| +
|
| +main() {
|
| + test([1, 2, 3]);
|
| + test(const ["foo", "bar"]);
|
| + test([]);
|
| + test(const []);
|
| +}
|
|
|