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

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

Issue 211243009: Implement MethodMirror.location in the VM. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add to api and fix type warnings Created 6 years, 9 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/method_mirror_location_test.dart ('k') | no next file » | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 that everything reachable from a [MirrorSystem] can be accessed. 5 // Test that everything reachable from a [MirrorSystem] can be accessed.
6 6
7 library test.mirrors.reader; 7 library test.mirrors.reader;
8 8
9 import 'dart:mirrors'; 9 import 'dart:mirrors';
10 import 'mirrors_reader.dart'; 10 import 'mirrors_reader.dart';
(...skipping 14 matching lines...) Expand all
25 if (tag.endsWith('.metadata')) { 25 if (tag.endsWith('.metadata')) {
26 return true;// Issue 10905. 26 return true;// Issue 10905.
27 } 27 }
28 } 28 }
29 return false; 29 return false;
30 } 30 }
31 31
32 bool expectUnsupported(var receiver, String tag, UnsupportedError exception) { 32 bool expectUnsupported(var receiver, String tag, UnsupportedError exception) {
33 // [DeclarationMirror.location] is intentionally not supported in runtime 33 // [DeclarationMirror.location] is intentionally not supported in runtime
34 // mirrors. 34 // mirrors.
35 if (receiver is DeclarationMirror && tag == 'location') { 35
36 return true;
37 }
38 if (mirrorSystemType == '_LocalMirrorSystem') { 36 if (mirrorSystemType == '_LocalMirrorSystem') {
39 // VM mirror system. 37 // VM mirror system.
38 if (receiver is DeclarationMirror && tag == 'location') {
39 return receiver is! MethodMirror;
40 }
40 } else if (mirrorSystemType == 'JsMirrorSystem') { 41 } else if (mirrorSystemType == 'JsMirrorSystem') {
41 // Dart2js runtime mirror system. 42 // Dart2js runtime mirror system.
43 if (receiver is DeclarationMirror && tag == 'location') {
44 return true;
45 }
42 } 46 }
43 return false; 47 return false;
44 } 48 }
45 } 49 }
46 50
47 void main([List<String> arguments = const <String>[]]) { 51 void main([List<String> arguments = const <String>[]]) {
48 MirrorSystem mirrors = currentMirrorSystem(); 52 MirrorSystem mirrors = currentMirrorSystem();
49 MirrorsReader reader = new RuntimeMirrorsReader(mirrors, 53 MirrorsReader reader = new RuntimeMirrorsReader(mirrors,
50 verbose: arguments.contains('-v'), 54 verbose: arguments.contains('-v'),
51 includeStackTrace: arguments.contains('-s')); 55 includeStackTrace: arguments.contains('-s'));
52 reader.checkMirrorSystem(mirrors); 56 reader.checkMirrorSystem(mirrors);
53 } 57 }
OLDNEW
« no previous file with comments | « tests/lib/mirrors/method_mirror_location_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698