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

Side by Side 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, 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2014, 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 library test.library_declarations_test;
ahe 2014/08/04 09:19:40 For consistency, consider changing name to match f
6
7 @MirrorsUsed(targets: "test.library_declarations_test")
ahe 2014/08/04 09:19:40 Ditto.
8 import 'dart:mirrors';
9 import 'package:expect/expect.dart';
10
11 class A {
12 static foo() => 499;
13 }
14
15 main() {
16 // Avoid inlining of nested closure.
17 var targetLibrary = const Symbol("test.library_declarations_test");
18 confuse(x) {
19 if (new DateTime.now().millisecondsSinceEpoch == 0) confuse(x + 1);
20 if (x != 0) {
21 Expect.fail("must be 0");
22 }
23 var keys = currentMirrorSystem().findLibrary(targetLibrary).declarations
24 .keys.toList();
25 Expect.equals(2, keys.length);
26 Expect.isTrue(#A == keys[0] || #main == keys[0]);
27 Expect.isTrue(#A == keys[1] || #main == keys[1]);
28 Expect.isTrue(keys[0] != keys[1]);
29 }
30 confuse(0);
31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698