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

Side by Side Diff: test_reflectable/test/meta_reflectors_test.dart

Issue 1391543003: Creates `reflectors`, as a meta-meta feature that enables dynamic selection of a "mirror system". (Closed) Base URL: https://github.com/dart-lang/reflectable.git@master
Patch Set: Review response. Created 5 years, 2 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
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart Team. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in
3 // the LICENSE file.
4
5 /// File being transformed by the reflectable transformer.
6 /// Creates a `MetaReflector` which may be used to reflect on the set of
7 /// reflectors themselves.
8 ///
9 /// Independence: This is the only library in this program where both the
10 /// reflector classes and the domain classes are seen together. The program
11 /// as a whole illustrates a number of ways in which it is possible to make
12 /// reflection, usage of reflection, and application specific classes (here
13 /// known as 'domain classes') independent of each other, statically and
14 /// dynamically.
15 library test_reflectable.test.meta_reflectors_test;
16
17 @GlobalQuantifyCapability(r"\.(M1|M2|M3|A|B|C|D)$", const Reflector())
18 @GlobalQuantifyCapability(r"\.(M1|M2|M3|B|C|D)$", const Reflector2())
19 @GlobalQuantifyCapability(r"\.(C|D)$", const ReflectorUpwardsClosed())
20 @GlobalQuantifyCapability(r"\.(C|D)$", const ReflectorUpwardsClosedToA())
21 @GlobalQuantifyCapability(r"\.(C|D)$", const ReflectorUpwardsClosedUntilA())
22 import "package:reflectable/reflectable.dart";
23 import "meta_reflectors_domain_definer.dart";
24 import "meta_reflectors_definer.dart";
25 import "meta_reflectors_meta.dart";
26 import "meta_reflectors_user.dart";
27
28 Map<String, Iterable<Reflectable>> scopeMap = <String, Iterable<Reflectable>>{
29 "polymer": <Reflectable>[const Reflector(), const ReflectorUpwardsClosed()],
30 "observe": <Reflectable>[const Reflector2(), const ReflectorUpwardsClosed()]
31 };
32
33 @ScopeMetaReflector()
34 Iterable<Reflectable> reflectablesOfScope(String scope) => scopeMap[scope];
35
36 main() {
37 runTests();
38 }
OLDNEW
« no previous file with comments | « test_reflectable/test/meta_reflectors_meta.dart ('k') | test_reflectable/test/meta_reflectors_user.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698