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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 remainder(other) => (this is JSInt) ? 42 : 42.2; | 332 remainder(other) => (this is JSInt) ? 42 : 42.2; |
333 truncate() => 42; | 333 truncate() => 42; |
334 }''', | 334 }''', |
335 'JSString': r''' | 335 'JSString': r''' |
336 class JSString extends Interceptor implements String, JSIndexable { | 336 class JSString extends Interceptor implements String, JSIndexable { |
337 var split; | 337 var split; |
338 var length; | 338 var length; |
339 operator[](index) {} | 339 operator[](index) {} |
340 toString() {} | 340 toString() {} |
341 operator+(other) => this; | 341 operator+(other) => this; |
| 342 codeUnitAt(index) => 42; |
342 }''', | 343 }''', |
343 'JSUInt31': 'class JSUInt31 extends JSUInt32 {}', | 344 'JSUInt31': 'class JSUInt31 extends JSUInt32 {}', |
344 'JSUInt32': 'class JSUInt32 extends JSPositiveInt {}', | 345 'JSUInt32': 'class JSUInt32 extends JSPositiveInt {}', |
345 'mapTypeToInterceptor': 'var mapTypeToInterceptor;', | 346 'mapTypeToInterceptor': 'var mapTypeToInterceptor;', |
346 'ObjectInterceptor': 'class ObjectInterceptor {}', | 347 'ObjectInterceptor': 'class ObjectInterceptor {}', |
347 'PlainJavaScriptObject': 'class PlainJavaScriptObject {}', | 348 'PlainJavaScriptObject': 'class PlainJavaScriptObject {}', |
348 'UnknownJavaScriptObject': 'class UnknownJavaScriptObject {}', | 349 'UnknownJavaScriptObject': 'class UnknownJavaScriptObject {}', |
349 }; | 350 }; |
350 | 351 |
351 const Map<String, String> DEFAULT_ISOLATE_HELPER_LIBRARY = | 352 const Map<String, String> DEFAULT_ISOLATE_HELPER_LIBRARY = |
352 const <String, String>{ | 353 const <String, String>{ |
353 'startRootIsolate': 'var startRootIsolate;', | 354 'startRootIsolate': 'var startRootIsolate;', |
354 '_currentIsolate': 'var _currentIsolate;', | 355 '_currentIsolate': 'var _currentIsolate;', |
355 '_callInIsolate': 'var _callInIsolate;', | 356 '_callInIsolate': 'var _callInIsolate;', |
356 '_WorkerBase': 'class _WorkerBase {}', | 357 '_WorkerBase': 'class _WorkerBase {}', |
357 }; | 358 }; |
358 | 359 |
359 const Map<String, String> DEFAULT_MIRRORS_LIBRARY = const <String, String>{ | 360 const Map<String, String> DEFAULT_MIRRORS_LIBRARY = const <String, String>{ |
360 'Comment': 'class Comment {}', | 361 'Comment': 'class Comment {}', |
361 'MirrorSystem': 'class MirrorSystem {}', | 362 'MirrorSystem': 'class MirrorSystem {}', |
362 'MirrorsUsed': 'class MirrorsUsed {}', | 363 'MirrorsUsed': 'class MirrorsUsed {}', |
363 }; | 364 }; |
364 | |
OLD | NEW |