OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 // VM-specific implementation of the dart:mirrors library. | 5 // VM-specific implementation of the dart:mirrors library. |
6 | 6 |
7 // These values are allowed to be passed directly over the wire. | 7 // These values are allowed to be passed directly over the wire. |
8 bool _isSimpleValue(var value) { | 8 bool _isSimpleValue(var value) { |
9 return (value == null || value is num || value is String || value is bool); | 9 return (value == null || value is num || value is String || value is bool); |
10 } | 10 } |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 case '\b' : | 237 case '\b' : |
238 output = r'\b'; | 238 output = r'\b'; |
239 break; | 239 break; |
240 case '\t' : | 240 case '\t' : |
241 output = r'\t'; | 241 output = r'\t'; |
242 break; | 242 break; |
243 case '\v' : | 243 case '\v' : |
244 output = r'\v'; | 244 output = r'\v'; |
245 break; | 245 break; |
246 default: | 246 default: |
247 int code = input.charCodeAt(0); | 247 // TODO(lrn): Someone decide if this should combine surrogate pairs. |
| 248 int code = input.codeUnitAt(0); |
248 if (isNice(code)) { | 249 if (isNice(code)) { |
249 output = input; | 250 output = input; |
250 } else { | 251 } else { |
251 output = '\\u{${code.toRadixString(16)}}'; | 252 output = '\\u{${code.toRadixString(16)}}'; |
252 } | 253 } |
253 break; | 254 break; |
254 } | 255 } |
255 buf.add(output); | 256 buf.add(output); |
256 } | 257 } |
257 return buf.toString(); | 258 return buf.toString(); |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
964 | 965 |
965 // Creates a new local InstanceMirror | 966 // Creates a new local InstanceMirror |
966 static InstanceMirror makeLocalInstanceMirror(Object reflectee) | 967 static InstanceMirror makeLocalInstanceMirror(Object reflectee) |
967 native 'Mirrors_makeLocalInstanceMirror'; | 968 native 'Mirrors_makeLocalInstanceMirror'; |
968 | 969 |
969 // Creates a new local mirror for some Object. | 970 // Creates a new local mirror for some Object. |
970 static InstanceMirror reflect(Object reflectee) { | 971 static InstanceMirror reflect(Object reflectee) { |
971 return makeLocalInstanceMirror(reflectee); | 972 return makeLocalInstanceMirror(reflectee); |
972 } | 973 } |
973 } | 974 } |
OLD | NEW |