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

Side by Side Diff: tests/lib/mirrors/operator_test.dart

Issue 62373008: - Reverting mirror changes. (Closed) Base URL: http://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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /// Test operators. 5 /// Test operators.
6 library test.operator_test; 6 library test.operator_test;
7 7
8 import 'dart:mirrors'; 8 import 'dart:mirrors';
9 9
10 import 'package:expect/expect.dart'; 10 import 'package:expect/expect.dart';
(...skipping 24 matching lines...) Expand all
35 35
36 // TODO(ahe): use void when dart2js reifies that type. 36 // TODO(ahe): use void when dart2js reifies that type.
37 operator []=(int a, Foo b) {} 37 operator []=(int a, Foo b) {}
38 } 38 }
39 39
40 void main() { 40 void main() {
41 ClassMirror cls = reflectClass(Foo); 41 ClassMirror cls = reflectClass(Foo);
42 var operators = new Map<Symbol, MethodMirror>(); 42 var operators = new Map<Symbol, MethodMirror>();
43 var operatorParameters = new Map<Symbol, List>(); 43 var operatorParameters = new Map<Symbol, List>();
44 var returnTypes = new Map<Symbol, Mirror>(); 44 var returnTypes = new Map<Symbol, Mirror>();
45 for (MethodMirror method in cls.declarations.values.where( 45 for (MethodMirror method in cls.methods.values) {
46 (d) => d is MethodMirror && !d.isConstructor)) {
47 Expect.isTrue(method.isRegularMethod); 46 Expect.isTrue(method.isRegularMethod);
48 Expect.isTrue(method.isOperator); 47 Expect.isTrue(method.isOperator);
49 Expect.isFalse(method.isGetter); 48 Expect.isFalse(method.isGetter);
50 Expect.isFalse(method.isSetter); 49 Expect.isFalse(method.isSetter);
51 Expect.isFalse(method.isAbstract); 50 Expect.isFalse(method.isAbstract);
52 operators[method.simpleName] = method; 51 operators[method.simpleName] = method;
53 operatorParameters[method.simpleName] = method.parameters; 52 operatorParameters[method.simpleName] = method.parameters;
54 returnTypes[method.simpleName] = method.returnType; 53 returnTypes[method.simpleName] = method.returnType;
55 } 54 }
56 expect(OPERATORS, operators); 55 expect(OPERATORS, operators);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 '>=: $FOO, ' 127 '>=: $FOO, '
129 '>>: $FOO, ' 128 '>>: $FOO, '
130 '[]: $FOO, ' 129 '[]: $FOO, '
131 '[]=: $DYNAMIC, ' 130 '[]=: $DYNAMIC, '
132 '^: $FOO, ' 131 '^: $FOO, '
133 'unary-: $FOO, ' 132 'unary-: $FOO, '
134 '|: $FOO, ' 133 '|: $FOO, '
135 '~: $FOO, ' 134 '~: $FOO, '
136 '~/: $FOO' 135 '~/: $FOO'
137 '}'; 136 '}';
OLDNEW
« no previous file with comments | « tests/lib/mirrors/mixin_members_test.dart ('k') | tests/lib/mirrors/parameter_metadata_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698