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

Side by Side Diff: dart/tests/lib/mirrors/constructors_test.dart

Issue 17601005: Implement JsClassMirror.constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased on CL 17601006 to fix issues in minified mode. Created 7 years, 6 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
« no previous file with comments | « dart/tests/lib/lib.status ('k') | dart/tests/lib/mirrors/reflect_model_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013, 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.constructors_test;
6
7 import 'dart:mirrors';
8
9 import 'package:expect/expect.dart';
10
11 import 'reflect_model_test.dart';
12
13 class Foo {
14 }
15
16 class Bar {
17 Bar();
18 }
19
20 class Baz {
21 Baz.named();
22 }
23
24 class Biz {
25 Biz();
26 Biz.named();
27 }
28
29 main() {
30 MirrorSystem mirrors = currentMirrorSystem();
31 ClassMirror fooMirror = reflectClass(Foo);
32 Map<Symbol, MethodMirror> fooConstructors = fooMirror.constructors;
33 ClassMirror barMirror = reflectClass(Bar);
34 Map<Symbol, MethodMirror> barConstructors = barMirror.constructors;
35 ClassMirror bazMirror = reflectClass(Baz);
36 Map<Symbol, MethodMirror> bazConstructors = bazMirror.constructors;
37 ClassMirror bizMirror = reflectClass(Biz);
38 Map<Symbol, MethodMirror> bizConstructors = bizMirror.constructors;
39
40 expect('{Foo: Method(s(Foo) in s(Foo), constructor)}', fooConstructors);
41 expect('{Bar: Method(s(Bar) in s(Bar), constructor)}', barConstructors);
42 expect('{Baz.named: Method(s(Baz.named) in s(Baz), constructor)}',
43 bazConstructors);
44 expect('{Biz: Method(s(Biz) in s(Biz), constructor),'
45 ' Biz.named: Method(s(Biz.named) in s(Biz), constructor)}',
46 bizConstructors);
47 print(bizConstructors);
48 }
OLDNEW
« no previous file with comments | « dart/tests/lib/lib.status ('k') | dart/tests/lib/mirrors/reflect_model_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698