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

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: 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
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 63%
copy from tests/lib/mirrors/unmangled_type_test.dart
copy to tests/lib/mirrors/parameter_is_const_test.dart
index dbc6b62437908677c6fb6c1dab670b8d0dd7d2b6..3bf14ae08425c4e9599bafa1ddb9325e21616fcd 100644
--- a/tests/lib/mirrors/unmangled_type_test.dart
+++ b/tests/lib/mirrors/parameter_is_const_test.dart
@@ -2,14 +2,17 @@
// 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(param) {}
ahe 2013/11/11 10:23:07 For completeness, how about adding: foo( const //
rmacnak 2013/11/11 17:54:22 Done.
}
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);
}

Powered by Google App Engine
This is Rietveld 408576698