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, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 '''; | 93 '''; |
94 | 94 |
95 const Map<String, String> DEFAULT_JS_HELPER_LIBRARY = const <String, String>{ | 95 const Map<String, String> DEFAULT_JS_HELPER_LIBRARY = const <String, String>{ |
96 'assertHelper': 'assertHelper(a) {}', | 96 'assertHelper': 'assertHelper(a) {}', |
97 'assertIsSubtype': 'assertIsSubtype(subtype, supertype, message) {}', | 97 'assertIsSubtype': 'assertIsSubtype(subtype, supertype, message) {}', |
98 'assertSubtype': 'assertSubtype(object, isField, checks, asField) {}', | 98 'assertSubtype': 'assertSubtype(object, isField, checks, asField) {}', |
99 'assertSubtypeOfRuntimeType': 'assertSubtypeOfRuntimeType(object, type) {}', | 99 'assertSubtypeOfRuntimeType': 'assertSubtypeOfRuntimeType(object, type) {}', |
100 'boolConversionCheck': 'boolConversionCheck(x) {}', | 100 'boolConversionCheck': 'boolConversionCheck(x) {}', |
101 'boolTypeCast': 'boolTypeCast(value) {}', | 101 'boolTypeCast': 'boolTypeCast(value) {}', |
102 'boolTypeCheck': 'boolTypeCheck(value) {}', | 102 'boolTypeCheck': 'boolTypeCheck(value) {}', |
| 103 'checkSubtype': 'checkSubtype(object, isField, checks, asField) {}', |
| 104 'checkSubtypeOfRuntimeType': 'checkSubtypeOfRuntimeType(o, t) {}', |
103 'BoundClosure': r'''abstract class BoundClosure extends Closure { | 105 'BoundClosure': r'''abstract class BoundClosure extends Closure { |
104 var self; | 106 var self; |
105 var target; | 107 var target; |
106 var receiver; | 108 var receiver; |
107 }''', | 109 }''', |
108 'buildFunctionType': | 110 'buildFunctionType': |
109 r'''buildFunctionType(returnType, parameterTypes, | 111 r'''buildFunctionType(returnType, parameterTypes, |
110 optionalParameterTypes) { | 112 optionalParameterTypes) { |
111 return new RuntimeFunctionType(); | 113 return new RuntimeFunctionType(); |
112 }''', | 114 }''', |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 'stringSuperNativeTypeCast': 'stringSuperNativeTypeCast(value) {}', | 200 'stringSuperNativeTypeCast': 'stringSuperNativeTypeCast(value) {}', |
199 'stringSuperNativeTypeCheck': 'stringSuperNativeTypeCheck(value) {}', | 201 'stringSuperNativeTypeCheck': 'stringSuperNativeTypeCheck(value) {}', |
200 'stringSuperTypeCast': 'stringSuperTypeCast(value) {}', | 202 'stringSuperTypeCast': 'stringSuperTypeCast(value) {}', |
201 'stringSuperTypeCheck': 'stringSuperTypeCheck(value) {}', | 203 'stringSuperTypeCheck': 'stringSuperTypeCheck(value) {}', |
202 'stringTypeCast': 'stringTypeCast(x) {}', | 204 'stringTypeCast': 'stringTypeCast(x) {}', |
203 'stringTypeCheck': 'stringTypeCheck(x) {}', | 205 'stringTypeCheck': 'stringTypeCheck(x) {}', |
204 'subtypeCast': 'subtypeCast(object, isField, checks, asField) {}', | 206 'subtypeCast': 'subtypeCast(object, isField, checks, asField) {}', |
205 'subtypeOfRuntimeTypeCast': 'subtypeOfRuntimeTypeCast(object, type) {}', | 207 'subtypeOfRuntimeTypeCast': 'subtypeOfRuntimeTypeCast(object, type) {}', |
206 'throwAbstractClassInstantiationError': | 208 'throwAbstractClassInstantiationError': |
207 'throwAbstractClassInstantiationError(className) {}', | 209 'throwAbstractClassInstantiationError(className) {}', |
208 'throwCyclicInit': 'throwCyclicInit() {}', | 210 'throwCyclicInit': 'throwCyclicInit(staticName) {}', |
209 'throwExpression': 'throwExpression(e) {}', | 211 'throwExpression': 'throwExpression(e) {}', |
210 'throwNoSuchMethod': | 212 'throwNoSuchMethod': |
211 'throwNoSuchMethod(obj, name, arguments, expectedArgumentNames) {}', | 213 'throwNoSuchMethod(obj, name, arguments, expectedArgumentNames) {}', |
212 'throwRuntimeError': 'throwRuntimeError(message) {}', | 214 'throwRuntimeError': 'throwRuntimeError(message) {}', |
213 'throwTypeError': 'throwTypeError(message) {}', | 215 'throwTypeError': 'throwTypeError(message) {}', |
214 'TypeImpl': 'class TypeImpl {}', | 216 'TypeImpl': 'class TypeImpl {}', |
215 'TypeVariable': 'class TypeVariable {}', | 217 'TypeVariable': 'class TypeVariable {}', |
216 'unwrapException': 'unwrapException(e) {}', | 218 'unwrapException': 'unwrapException(e) {}', |
217 'voidTypeCheck': 'voidTypeCheck(value) {}', | 219 'voidTypeCheck': 'voidTypeCheck(value) {}', |
218 'wrapException': 'wrapException(x) { return x; }', | 220 'wrapException': 'wrapException(x) { return x; }', |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 const Map<String, String> DEFAULT_ASYNC_LIBRARY = const <String, String>{ | 363 const Map<String, String> DEFAULT_ASYNC_LIBRARY = const <String, String>{ |
362 'Future': 'class Future<T> {}', | 364 'Future': 'class Future<T> {}', |
363 'Stream': 'class Stream<T> {}', | 365 'Stream': 'class Stream<T> {}', |
364 }; | 366 }; |
365 | 367 |
366 const Map<String, String> DEFAULT_MIRRORS_LIBRARY = const <String, String>{ | 368 const Map<String, String> DEFAULT_MIRRORS_LIBRARY = const <String, String>{ |
367 'Comment': 'class Comment {}', | 369 'Comment': 'class Comment {}', |
368 'MirrorSystem': 'class MirrorSystem {}', | 370 'MirrorSystem': 'class MirrorSystem {}', |
369 'MirrorsUsed': 'class MirrorsUsed {}', | 371 'MirrorsUsed': 'class MirrorsUsed {}', |
370 }; | 372 }; |
OLD | NEW |