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

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

Issue 58183003: Implement VariableMirror.isConst in the VM and ParameterMirror.isConst in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: git cl dcommit Created 7 years, 1 month 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 | « tests/lib/lib.status ('k') | tests/lib/mirrors/variable_is_const_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/lib/mirrors/parameter_is_const_test.dart
diff --git a/tests/lib/mirrors/unmangled_type_test.dart b/tests/lib/mirrors/parameter_is_const_test.dart
similarity index 58%
copy from tests/lib/mirrors/unmangled_type_test.dart
copy to tests/lib/mirrors/parameter_is_const_test.dart
index dbc6b62437908677c6fb6c1dab670b8d0dd7d2b6..45185a9b88d15539aa12dbc1f65b2cc2269e7be3 100644
--- a/tests/lib/mirrors/unmangled_type_test.dart
+++ b/tests/lib/mirrors/parameter_is_const_test.dart
@@ -2,14 +2,19 @@
// 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;
+
import 'dart:mirrors';
import 'package:expect/expect.dart';
-class Foo {
+class Class {
+ foo(
+ const /// 01: compile-time error
+ param) {}
}
main() {
- Expect.stringEquals('Foo', '${new Foo().runtimeType}');
- Expect.stringEquals('foo', MirrorSystem.getName(new Symbol('foo')));
+ MethodMirror mm = reflectClass(Class).declarations[#foo];
+ Expect.isFalse(mm.parameters.single.isConst);
}
« no previous file with comments | « tests/lib/lib.status ('k') | tests/lib/mirrors/variable_is_const_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698