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 const DEFAULT_PLATFORM_CONFIG = """ | 9 const DEFAULT_PLATFORM_CONFIG = """ |
10 [libraries] | 10 [libraries] |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 'Iterable': ''' | 57 'Iterable': ''' |
58 abstract class Iterable<E> { | 58 abstract class Iterable<E> { |
59 Iterator<E> get iterator => null; | 59 Iterator<E> get iterator => null; |
60 }''', | 60 }''', |
61 'Iterator': ''' | 61 'Iterator': ''' |
62 abstract class Iterator<E> { | 62 abstract class Iterator<E> { |
63 E get current => null; | 63 E get current => null; |
64 }''', | 64 }''', |
65 'LinkedHashMap': r''' | 65 'LinkedHashMap': r''' |
66 class LinkedHashMap<K, V> implements Map<K, V> { | 66 class LinkedHashMap<K, V> implements Map<K, V> { |
67 factory LinkedHashMap._empty() => null; | |
68 factory LinkedHashMap._literal(elements) => null; | |
69 static _makeEmpty() => null; | |
70 static _makeLiteral(elements) => null; | |
71 }''', | 67 }''', |
72 'List': r''' | 68 'List': r''' |
73 class List<E> extends Iterable<E> { | 69 class List<E> extends Iterable<E> { |
74 var length; | 70 var length; |
75 List([length]); | 71 List([length]); |
76 List.filled(length, element); | 72 List.filled(length, element); |
77 E get first => null; | 73 E get first => null; |
78 E get last => null; | 74 E get last => null; |
79 E get single => null; | 75 E get single => null; |
80 E removeLast() => null; | 76 E removeLast() => null; |
(...skipping 25 matching lines...) Expand all Loading... |
106 'Symbol': 'class Symbol { final name; const Symbol(this.name); }', | 102 'Symbol': 'class Symbol { final name; const Symbol(this.name); }', |
107 'Type': 'class Type {}', | 103 'Type': 'class Type {}', |
108 'Pattern': 'abstract class Pattern {}', | 104 'Pattern': 'abstract class Pattern {}', |
109 }; | 105 }; |
110 | 106 |
111 const String DEFAULT_PATCH_CORE_SOURCE = r''' | 107 const String DEFAULT_PATCH_CORE_SOURCE = r''' |
112 import 'dart:_js_helper'; | 108 import 'dart:_js_helper'; |
113 import 'dart:_interceptors'; | 109 import 'dart:_interceptors'; |
114 import 'dart:_isolate_helper'; | 110 import 'dart:_isolate_helper'; |
115 import 'dart:async'; | 111 import 'dart:async'; |
| 112 |
| 113 @patch |
| 114 class LinkedHashMap<K, V> { |
| 115 factory LinkedHashMap._empty() => null; |
| 116 factory LinkedHashMap._literal(elements) => null; |
| 117 static _makeEmpty() => null; |
| 118 static _makeLiteral(elements) => null; |
| 119 } |
116 '''; | 120 '''; |
117 | 121 |
118 const Map<String, String> DEFAULT_JS_HELPER_LIBRARY = const <String, String>{ | 122 const Map<String, String> DEFAULT_JS_HELPER_LIBRARY = const <String, String>{ |
119 'assertTest': 'assertTest(a) {}', | 123 'assertTest': 'assertTest(a) {}', |
120 'assertThrow': 'assertThrow(a) {}', | 124 'assertThrow': 'assertThrow(a) {}', |
121 'assertHelper': 'assertHelper(a) {}', | 125 'assertHelper': 'assertHelper(a) {}', |
122 'assertUnreachable': 'assertUnreachable() {}', | 126 'assertUnreachable': 'assertUnreachable() {}', |
123 'assertIsSubtype': 'assertIsSubtype(subtype, supertype, message) {}', | 127 'assertIsSubtype': 'assertIsSubtype(subtype, supertype, message) {}', |
124 'assertSubtype': 'assertSubtype(object, isField, checks, asField) {}', | 128 'assertSubtype': 'assertSubtype(object, isField, checks, asField) {}', |
125 'assertSubtypeOfRuntimeType': 'assertSubtypeOfRuntimeType(object, type) {}', | 129 'assertSubtypeOfRuntimeType': 'assertSubtypeOfRuntimeType(object, type) {}', |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 | 460 |
457 const LookupMap(this._entries, [this._nestedMaps = const []]) | 461 const LookupMap(this._entries, [this._nestedMaps = const []]) |
458 : _key = null, _value = null; | 462 : _key = null, _value = null; |
459 | 463 |
460 const LookupMap.pair(this._key, this._value) | 464 const LookupMap.pair(this._key, this._value) |
461 : _entries = const [], _nestedMaps = const []; | 465 : _entries = const [], _nestedMaps = const []; |
462 V operator[](K k) => null; | 466 V operator[](K k) => null; |
463 }''', | 467 }''', |
464 '_version': 'const _version = "0.0.1+1";', | 468 '_version': 'const _version = "0.0.1+1";', |
465 }; | 469 }; |
OLD | NEW |