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

Unified Diff: tests/lib/mirrors/library_declarations2_test.dart

Issue 416873002: Don't include class-static functions in library mirror. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix typos. Created 6 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
Index: tests/lib/mirrors/library_declarations2_test.dart
diff --git a/tests/lib/mirrors/library_declarations2_test.dart b/tests/lib/mirrors/library_declarations2_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..f0167a8d06e41d6b4b0b4dfebadbfe2f5938c619
--- /dev/null
+++ b/tests/lib/mirrors/library_declarations2_test.dart
@@ -0,0 +1,31 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// 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.
+
+library test.library_declarations_test;
ahe 2014/08/04 09:19:40 For consistency, consider changing name to match f
+
+@MirrorsUsed(targets: "test.library_declarations_test")
ahe 2014/08/04 09:19:40 Ditto.
+import 'dart:mirrors';
+import 'package:expect/expect.dart';
+
+class A {
+ static foo() => 499;
+}
+
+main() {
+ // Avoid inlining of nested closure.
+ var targetLibrary = const Symbol("test.library_declarations_test");
+ confuse(x) {
+ if (new DateTime.now().millisecondsSinceEpoch == 0) confuse(x + 1);
+ if (x != 0) {
+ Expect.fail("must be 0");
+ }
+ var keys = currentMirrorSystem().findLibrary(targetLibrary).declarations
+ .keys.toList();
+ Expect.equals(2, keys.length);
+ Expect.isTrue(#A == keys[0] || #main == keys[0]);
+ Expect.isTrue(#A == keys[1] || #main == keys[1]);
+ Expect.isTrue(keys[0] != keys[1]);
+ }
+ confuse(0);
+}

Powered by Google App Engine
This is Rietveld 408576698