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

Unified Diff: test/codegen/lib/mirrors/is_odd_test.dart

Issue 2265533002: Add mirrors tests (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 4 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
Index: test/codegen/lib/mirrors/is_odd_test.dart
diff --git a/test/codegen/language/interceptor7_test.dart b/test/codegen/lib/mirrors/is_odd_test.dart
similarity index 50%
copy from test/codegen/language/interceptor7_test.dart
copy to test/codegen/lib/mirrors/is_odd_test.dart
index 965ddfc800c1b1fa7971bd918391b1e806c00cf3..0dc1655c8244dc34f95b505a235174b0fd403dcb 100644
--- a/test/codegen/language/interceptor7_test.dart
+++ b/test/codegen/lib/mirrors/is_odd_test.dart
@@ -2,15 +2,15 @@
// 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.
-// Test that dart2js uses the right interceptor when call a method on
-// something that has type number.
+/// Test that otherwise unused intercepted methods are reified correctly. This
+/// was a bug in dart2js.
+library test.is_odd_test;
-import 'package:expect/expect.dart';
+import 'dart:mirrors';
-var array = [];
+import 'package:expect/expect.dart';
main() {
- array.add(false);
- var x = array[0] ? 1.5 : 2;
- Expect.isTrue(x.isEven);
+ Expect.isTrue(reflect(1).getField(#isOdd).reflectee);
+ Expect.isFalse(reflect(2).getField(#isOdd).reflectee);
}
« no previous file with comments | « test/codegen/lib/mirrors/io_html_mutual_exclusion_test.dart ('k') | test/codegen/lib/mirrors/lazy_static_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698