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

Unified Diff: tests/lib/mirrors/unused_mirrors_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_mirrors_test.dart
diff --git a/tests/lib/mirrors/unmangled_type_test.dart b/tests/lib/mirrors/unused_mirrors_test.dart
similarity index 51%
copy from tests/lib/mirrors/unmangled_type_test.dart
copy to tests/lib/mirrors/unused_mirrors_test.dart
index dbc6b62437908677c6fb6c1dab670b8d0dd7d2b6..fcbc08aa56898ea761d80d932707acead9bb2245 100644
--- a/tests/lib/mirrors/unmangled_type_test.dart
+++ b/tests/lib/mirrors/unused_mirrors_test.dart
@@ -2,14 +2,20 @@
// 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.
+
+@MirrorsUsed(targets: const ["foo"])
import 'dart:mirrors';
-import 'package:expect/expect.dart';
+Bar foo = new Bar();
+
+typedef int FunctionTypeDef();
-class Foo {
+class Bar {
+ final FunctionTypeDef gee;
}
main() {
- Expect.stringEquals('Foo', '${new Foo().runtimeType}');
- Expect.stringEquals('foo', MirrorSystem.getName(new Symbol('foo')));
+ // Don't do anything.
}

Powered by Google App Engine
This is Rietveld 408576698