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

Unified Diff: tests/compiler/dart2js_extra/lookup_map/discovered_code_test.dart

Issue 1320503003: dart2js: add initial support for lookup-maps (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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/compiler/dart2js_extra/lookup_map/discovered_code_test.dart
diff --git a/tests/compiler/dart2js_extra/lookup_map/discovered_code_test.dart b/tests/compiler/dart2js_extra/lookup_map/discovered_code_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..a20af7318600b32a72c6dab92cec17296f85fee4
--- /dev/null
+++ b/tests/compiler/dart2js_extra/lookup_map/discovered_code_test.dart
@@ -0,0 +1,23 @@
+// Copyright (c) 2015, 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.
+
+import 'package:lookup_map/lookup_map.dart';
+import 'package:expect/expect.dart';
+
+class A{ A(B x);}
+class B{}
+class C{}
+class D{}
+class E{}
+createA() => new A(map[B][1]());
+createB() => new B();
+const map = const LookupMap(const [
+ A, const ["the-text-for-A", createA],
+ B, const ["the-text-for-B", createB],
+ C, const ["the-text-for-C"],
+]);
+
+main() {
+ Expect.isTrue(map[A][1]() is A);
+}

Powered by Google App Engine
This is Rietveld 408576698