Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(473)

Unified Diff: tests/compiler/dart2js_extra/23804_test.dart

Issue 1230463003: dart2js: include 'any' and 'every' as possibly escaping the values in the collection (fix #23804) (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/inferrer/node_tracer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js_extra/23804_test.dart
diff --git a/tests/language/dead_field_access_test.dart b/tests/compiler/dart2js_extra/23804_test.dart
similarity index 53%
copy from tests/language/dead_field_access_test.dart
copy to tests/compiler/dart2js_extra/23804_test.dart
index e3fc11b6c5f33af074b45ea57a53194aadb20daa..2fad1d5aea7cb657d8addb618732809335744a19 100644
--- a/tests/language/dead_field_access_test.dart
+++ b/tests/compiler/dart2js_extra/23804_test.dart
@@ -2,19 +2,14 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-import 'package:expect/expect.dart';
-
-class Foo {
- var field = 10;
-}
+// Regression test for http://dartbug.com/23804/
+// Inference incorrectly assumed that `any` and `every` didn't escape the values
+// in the collections.
-@NoInline()
-getField(x) {
- x.field;
- return 34;
-}
+import 'package:expect/expect.dart';
+test(n) => n == 1;
+run(f) => f(1);
main() {
- Expect.equals(34, getField(new Foo()));
- Expect.throws(() => getField(null));
+ Expect.equals([test].any(run), true);
}
« no previous file with comments | « pkg/compiler/lib/src/inferrer/node_tracer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698