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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test_reflectable/test/meta_reflectors_test.dart
diff --git a/test_reflectable/test/meta_reflectors_test.dart b/test_reflectable/test/meta_reflectors_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..55f3af06194eb6001b0c7369dfe9abfe6faba262
--- /dev/null
+++ b/test_reflectable/test/meta_reflectors_test.dart
@@ -0,0 +1,38 @@
+// Copyright (c) 2015, the Dart Team. All rights reserved. Use of this
+// source code is governed by a BSD-style license that can be found in
+// the LICENSE file.
+
+/// File being transformed by the reflectable transformer.
+/// Creates a `MetaReflector` which may be used to reflect on the set of
+/// reflectors themselves.
+///
+/// Independence: This is the only library in this program where both the
+/// reflector classes and the domain classes are seen together. The program
+/// as a whole illustrates a number of ways in which it is possible to make
+/// reflection, usage of reflection, and application specific classes (here
+/// known as 'domain classes') independent of each other, statically and
+/// dynamically.
+library test_reflectable.test.meta_reflectors_test;
+
+@GlobalQuantifyCapability(r"\.(M1|M2|M3|A|B|C|D)$", const Reflector())
+@GlobalQuantifyCapability(r"\.(M1|M2|M3|B|C|D)$", const Reflector2())
+@GlobalQuantifyCapability(r"\.(C|D)$", const ReflectorUpwardsClosed())
+@GlobalQuantifyCapability(r"\.(C|D)$", const ReflectorUpwardsClosedToA())
+@GlobalQuantifyCapability(r"\.(C|D)$", const ReflectorUpwardsClosedUntilA())
+import "package:reflectable/reflectable.dart";
+import "meta_reflectors_domain_definer.dart";
+import "meta_reflectors_definer.dart";
+import "meta_reflectors_meta.dart";
+import "meta_reflectors_user.dart";
+
+Map<String, Iterable<Reflectable>> scopeMap = <String, Iterable<Reflectable>>{
+ "polymer": <Reflectable>[const Reflector(), const ReflectorUpwardsClosed()],
+ "observe": <Reflectable>[const Reflector2(), const ReflectorUpwardsClosed()]
+};
+
+@ScopeMetaReflector()
+Iterable<Reflectable> reflectablesOfScope(String scope) => scopeMap[scope];
+
+main() {
+ runTests();
+}
« 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