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

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

Issue 18216002: Implement JsMethodMirror.constructorName. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Address comments Created 7 years, 5 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 | « dart/tests/lib/mirrors/constructors_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) 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 /// Helper methods for converting a [Mirror] to a [String]. 5 /// Helper methods for converting a [Mirror] to a [String].
6 library test.stringify; 6 library test.stringify;
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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 if (value is ParameterMirror) return stringifyParameter(value); 96 if (value is ParameterMirror) return stringifyParameter(value);
97 if (value is VariableMirror) return stringifyVariable(value); 97 if (value is VariableMirror) return stringifyVariable(value);
98 if (value is MethodMirror) return stringifyMethod(value); 98 if (value is MethodMirror) return stringifyMethod(value);
99 if (value is Symbol) return stringifySymbol(value); 99 if (value is Symbol) return stringifySymbol(value);
100 if (value is TypeMirror) return stringifyType(value); 100 if (value is TypeMirror) return stringifyType(value);
101 if (value == null) return '<null>'; 101 if (value == null) return '<null>';
102 throw 'Unexpected value: $value'; 102 throw 'Unexpected value: $value';
103 } 103 }
104 104
105 expect(expected, actual) => Expect.stringEquals(expected, stringify(actual)); 105 expect(expected, actual) => Expect.stringEquals(expected, stringify(actual));
106
107 compareSymbols(Symbol a, Symbol b) {
108 return MirrorSystem.getName(a).compareTo(MirrorSystem.getName(b));
109 }
OLDNEW
« no previous file with comments | « dart/tests/lib/mirrors/constructors_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698