| OLD | NEW |
| 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 // Library for creating mock versions of platform and internal libraries. | 5 // Library for creating mock versions of platform and internal libraries. |
| 6 | 6 |
| 7 library mock_libraries; | 7 library mock_libraries; |
| 8 | 8 |
| 9 String buildLibrarySource( | 9 String buildLibrarySource( |
| 10 Map<String, String> elementMap, | 10 Map<String, String> elementMap, |
| 11 [Map<String, String> additionalElementMap = const <String, String>{}]) { | 11 [Map<String, String> additionalElementMap = const <String, String>{}]) { |
| 12 Map<String, String> map = new Map<String, String>.from(elementMap); | 12 Map<String, String> map = new Map<String, String>.from(elementMap); |
| 13 if (additionalElementMap != null) { | 13 if (additionalElementMap != null) { |
| 14 map.addAll(additionalElementMap); | 14 map.addAll(additionalElementMap); |
| 15 } | 15 } |
| 16 StringBuffer sb = new StringBuffer(); | 16 StringBuffer sb = new StringBuffer(); |
| 17 map.values.forEach((String element) { | 17 map.values.forEach((String element) { |
| 18 sb.write('$element\n'); | 18 sb.write('$element\n'); |
| 19 }); | 19 }); |
| 20 return sb.toString(); | 20 return sb.toString(); |
| 21 } | 21 } |
| 22 | 22 |
| 23 const Map<String, String> DEFAULT_CORE_LIBRARY = const <String, String>{ | 23 const Map<String, String> DEFAULT_CORE_LIBRARY = const <String, String>{ |
| 24 'bool': 'class bool {}', | 24 'bool': 'class bool {}', |
| 25 'Comparator': 'abstract class Comparator<T> {}', |
| 25 'DateTime': r''' | 26 'DateTime': r''' |
| 26 class DateTime { | 27 class DateTime { |
| 27 DateTime(year); | 28 DateTime(year); |
| 28 DateTime.utc(year); | 29 DateTime.utc(year); |
| 29 }''', | 30 }''', |
| 31 'deprecated': 'const deprecated = 0;', |
| 30 'double': r''' | 32 'double': r''' |
| 31 abstract class double extends num { | 33 abstract class double extends num { |
| 32 static var NAN = 0; | 34 static var NAN = 0; |
| 33 static parse(s) {} | 35 static parse(s) {} |
| 34 }''', | 36 }''', |
| 35 'Function': 'class Function {}', | 37 'Function': 'class Function {}', |
| 36 'identical': 'bool identical(Object a, Object b) { return true; }', | 38 'identical': 'bool identical(Object a, Object b) { return true; }', |
| 37 'int': 'abstract class int extends num { }', | 39 'int': 'abstract class int extends num { }', |
| 38 'LinkedHashMap': r''' | 40 'LinkedHashMap': r''' |
| 39 class LinkedHashMap { | 41 class LinkedHashMap { |
| (...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 '_callInIsolate': 'var _callInIsolate;', | 350 '_callInIsolate': 'var _callInIsolate;', |
| 349 '_WorkerBase': 'class _WorkerBase {}', | 351 '_WorkerBase': 'class _WorkerBase {}', |
| 350 }; | 352 }; |
| 351 | 353 |
| 352 const Map<String, String> DEFAULT_MIRRORS_LIBRARY = const <String, String>{ | 354 const Map<String, String> DEFAULT_MIRRORS_LIBRARY = const <String, String>{ |
| 353 'Comment': 'class Comment {}', | 355 'Comment': 'class Comment {}', |
| 354 'MirrorSystem': 'class MirrorSystem {}', | 356 'MirrorSystem': 'class MirrorSystem {}', |
| 355 'MirrorsUsed': 'class MirrorsUsed {}', | 357 'MirrorsUsed': 'class MirrorsUsed {}', |
| 356 }; | 358 }; |
| 357 | 359 |
| OLD | NEW |