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

Unified Diff: tests/lib/mirrors/unused_mirrors8_test.dart

Issue 142193005: Fix JS-backend when MirrorsUsed target a static field, but there is no mirrors usage. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: One more test. Created 6 years, 11 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/lib/mirrors/unused_mirrors8_test.dart
diff --git a/tests/lib/mirrors/unused_mirrors8_test.dart b/tests/lib/mirrors/unused_mirrors8_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..e2326c9f36fd0f2b275665578921ecacc585d2a0
--- /dev/null
+++ b/tests/lib/mirrors/unused_mirrors8_test.dart
@@ -0,0 +1,25 @@
+// Copyright (c) 2013, 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.
+
+// Tests that MirrorsUsed without usage of the static field does not crash
+// dart2js.
+
+library lib;
+
+@MirrorsUsed(targets: const ["lib"])
+import 'dart:mirrors';
+
+class C {
+ static Bar foo = new Bar();
+}
+
+typedef int FunctionTypeDef();
+
+class Bar {
+ final FunctionTypeDef gee;
+}
+
+main() {
+ // Don't do anything.
+}

Powered by Google App Engine
This is Rietveld 408576698