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

Unified Diff: tests/lib/mirrors/unused_mirrors2_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_mirrors2_test.dart
diff --git a/tests/lib/mirrors/parameter_is_const_test.dart b/tests/lib/mirrors/unused_mirrors2_test.dart
similarity index 50%
copy from tests/lib/mirrors/parameter_is_const_test.dart
copy to tests/lib/mirrors/unused_mirrors2_test.dart
index 45185a9b88d15539aa12dbc1f65b2cc2269e7be3..9ce81af122926d2595bb198d096586a285c2d64f 100644
--- a/tests/lib/mirrors/parameter_is_const_test.dart
+++ b/tests/lib/mirrors/unused_mirrors2_test.dart
@@ -2,19 +2,22 @@
// 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.
-library test.parameter_is_const;
+// Tests that MirrorsUsed without usage of the static field does not crash
+// dart2js.
+library lib;
+
+@MirrorsUsed(targets: const ["lib"])
import 'dart:mirrors';
-import 'package:expect/expect.dart';
+Bar foo = new Bar();
+
+typedef int FunctionTypeDef();
-class Class {
- foo(
- const /// 01: compile-time error
- param) {}
+class Bar {
+ final FunctionTypeDef gee;
}
main() {
- MethodMirror mm = reflectClass(Class).declarations[#foo];
- Expect.isFalse(mm.parameters.single.isConst);
+ // Don't do anything.
}

Powered by Google App Engine
This is Rietveld 408576698