| 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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 get hashCode => throw "Interceptor.hashCode not implemented."; | 297 get hashCode => throw "Interceptor.hashCode not implemented."; |
| 298 noSuchMethod(im) { throw im; } | 298 noSuchMethod(im) { throw im; } |
| 299 }''', | 299 }''', |
| 300 'JSArray': r''' | 300 'JSArray': r''' |
| 301 class JSArray<E> extends Interceptor implements List<E>, JSIndexable { | 301 class JSArray<E> extends Interceptor implements List<E>, JSIndexable { |
| 302 JSArray(); | 302 JSArray(); |
| 303 factory JSArray.typed(a) => a; | 303 factory JSArray.typed(a) => a; |
| 304 var length; | 304 var length; |
| 305 operator[](index) => this[index]; | 305 operator[](index) => this[index]; |
| 306 operator[]=(index, value) { this[index] = value; } | 306 operator[]=(index, value) { this[index] = value; } |
| 307 add(value) { this[length + 1] = value; } | 307 add(value) { this[length] = value; } |
| 308 insert(index, value) {} | 308 insert(index, value) {} |
| 309 E get first => this[0]; | 309 E get first => this[0]; |
| 310 E get last => this[0]; | 310 E get last => this[0]; |
| 311 E get single => this[0]; | 311 E get single => this[0]; |
| 312 E removeLast() => this[0]; | 312 E removeLast() => this[0]; |
| 313 E removeAt(index) => this[0]; | 313 E removeAt(index) => this[0]; |
| 314 E elementAt(index) => this[0]; | 314 E elementAt(index) => this[0]; |
| 315 E singleWhere(f) => this[0]; | 315 E singleWhere(f) => this[0]; |
| 316 Iterator<E> get iterator => null; | 316 Iterator<E> get iterator => null; |
| 317 }''', | 317 }''', |
| 318 'JSBool': 'class JSBool extends Interceptor implements bool {}', | 318 'JSBool': 'class JSBool extends Interceptor implements bool {}', |
| 319 'JSDouble': 'class JSDouble extends JSNumber implements double {}', | 319 'JSDouble': 'class JSDouble extends JSNumber implements double {}', |
| 320 'JSExtendableArray': 'class JSExtendableArray extends JSMutableArray {}', | 320 'JSExtendableArray': 'class JSExtendableArray extends JSMutableArray {}', |
| 321 'JSFixedArray': 'class JSFixedArray extends JSMutableArray {}', | 321 'JSFixedArray': 'class JSFixedArray extends JSMutableArray {}', |
| 322 'JSFunction': | 322 'JSFunction': |
| 323 'abstract class JSFunction extends Interceptor implements Function {}', | 323 'abstract class JSFunction extends Interceptor implements Function {}', |
| 324 'JSIndexable': r''' | 324 'JSIndexable': r''' |
| 325 abstract class JSIndexable { | 325 abstract class JSIndexable { |
| 326 get length; | 326 get length; |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 | 462 |
| 463 const LookupMap(this._entries, [this._nestedMaps = const []]) | 463 const LookupMap(this._entries, [this._nestedMaps = const []]) |
| 464 : _key = null, _value = null; | 464 : _key = null, _value = null; |
| 465 | 465 |
| 466 const LookupMap.pair(this._key, this._value) | 466 const LookupMap.pair(this._key, this._value) |
| 467 : _entries = const [], _nestedMaps = const []; | 467 : _entries = const [], _nestedMaps = const []; |
| 468 V operator[](K k) => null; | 468 V operator[](K k) => null; |
| 469 }''', | 469 }''', |
| 470 '_version': 'const _version = "0.0.1+1";', | 470 '_version': 'const _version = "0.0.1+1";', |
| 471 }; | 471 }; |
| OLD | NEW |