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

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

Issue 236313012: Don't hide interceptors in mirrors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/lib/mirrors/intercepted_class_test.dart ('k') | tests/lib/mirrors/mirrors_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Ensure that objects handled specially by dart2js can be reflected on. 5 // Ensure that objects handled specially by dart2js can be reflected on.
6 6
7 library test.intercepted_object_test; 7 library test.intercepted_object_test;
8 8
9 import 'dart:mirrors'; 9 import 'dart:mirrors';
10 10
11 import 'stringify.dart' show stringify, expect; 11 import 'stringify.dart' show stringify, expect;
12 12
13 import 'intercepted_class_test.dart' show checkClassMirror; 13 import 'intercepted_class_test.dart' show checkClassMirrorMethods;
14 14
15 checkObject(object, String name) { 15 checkImplements(object, String name) {
16 checkClassMirror(reflect(object).type, name); 16 ClassMirror cls = reflect(object).type;
17 checkClassMirrorMethods(cls);
18
19 List<ClassMirror> superinterfaces = cls.superinterfaces;
20 String symName = 's($name)';
21 for (ClassMirror superinterface in superinterfaces) {
22 print(superinterface.simpleName);
23 if (symName == stringify(superinterface.simpleName)) {
24 checkClassMirrorMethods(superinterface);
25 return;
26 }
27 }
28
29 // TODO(floitsch): use correct fail
30 expect(name, "super interface not found");
17 } 31 }
18 32
19 main() { 33 main() {
20 checkObject('', 'String'); 34 checkImplements('', 'String');
21 checkObject(1, 'int'); 35 checkImplements(1, 'int');
22 checkObject(1.5, 'double'); 36 checkImplements(1.5, 'double');
23 checkObject(true, 'bool'); 37 checkImplements(true, 'bool');
24 checkObject(false, 'bool'); 38 checkImplements(false, 'bool');
25 checkObject([], 'List'); 39 checkImplements([], 'List');
26 } 40 }
OLDNEW
« no previous file with comments | « tests/lib/mirrors/intercepted_class_test.dart ('k') | tests/lib/mirrors/mirrors_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698