| 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 analyzer.test.src.context.mock_sdk; | 5 library analyzer.test.src.context.mock_sdk; |
| 6 | 6 |
| 7 import 'package:analyzer/file_system/file_system.dart' as resource; | 7 import 'package:analyzer/file_system/file_system.dart' as resource; |
| 8 import 'package:analyzer/file_system/memory_file_system.dart' as resource; | 8 import 'package:analyzer/file_system/memory_file_system.dart' as resource; |
| 9 import 'package:analyzer/src/context/cache.dart'; | 9 import 'package:analyzer/src/context/cache.dart'; |
| 10 import 'package:analyzer/src/context/context.dart'; | 10 import 'package:analyzer/src/context/context.dart'; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 factory Future.value([T value]) => null; | 29 factory Future.value([T value]) => null; |
| 30 | 30 |
| 31 static Future<List/*<T>*/> wait/*<T>*/( | 31 static Future<List/*<T>*/> wait/*<T>*/( |
| 32 Iterable<Future/*<T>*/> futures) => null; | 32 Iterable<Future/*<T>*/> futures) => null; |
| 33 Future/*<R>*/ then/*<R>*/(/*=R*/ onValue(T value)) => null; | 33 Future/*<R>*/ then/*<R>*/(/*=R*/ onValue(T value)) => null; |
| 34 } | 34 } |
| 35 ''', | 35 ''', |
| 36 const <String, String>{ | 36 const <String, String>{ |
| 37 '/lib/async/stream.dart': r''' | 37 '/lib/async/stream.dart': r''' |
| 38 part of dart.async; | 38 part of dart.async; |
| 39 class Stream<T> {} | 39 class Stream<T> { |
| 40 Future<T> get first; |
| 41 } |
| 40 abstract class StreamTransformer<S, T> {} | 42 abstract class StreamTransformer<S, T> {} |
| 41 ''' | 43 ''' |
| 42 }); | 44 }); |
| 43 | 45 |
| 44 const _MockSdkLibrary _LIB_COLLECTION = const _MockSdkLibrary( | 46 const _MockSdkLibrary _LIB_COLLECTION = const _MockSdkLibrary( |
| 45 'dart:collection', | 47 'dart:collection', |
| 46 '/lib/collection/collection.dart', | 48 '/lib/collection/collection.dart', |
| 47 ''' | 49 ''' |
| 48 library dart.collection; | 50 library dart.collection; |
| 49 | 51 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 abstract class num implements Comparable<num> { | 107 abstract class num implements Comparable<num> { |
| 106 bool operator <(num other); | 108 bool operator <(num other); |
| 107 bool operator <=(num other); | 109 bool operator <=(num other); |
| 108 bool operator >(num other); | 110 bool operator >(num other); |
| 109 bool operator >=(num other); | 111 bool operator >=(num other); |
| 110 num operator +(num other); | 112 num operator +(num other); |
| 111 num operator -(num other); | 113 num operator -(num other); |
| 112 num operator *(num other); | 114 num operator *(num other); |
| 113 num operator /(num other); | 115 num operator /(num other); |
| 114 int toInt(); | 116 int toInt(); |
| 117 double toDouble(); |
| 115 num abs(); | 118 num abs(); |
| 116 int round(); | 119 int round(); |
| 117 } | 120 } |
| 118 abstract class int extends num { | 121 abstract class int extends num { |
| 119 bool get isEven => false; | 122 bool get isEven => false; |
| 120 int operator -(); | 123 int operator -(); |
| 121 external static int parse(String source, | 124 external static int parse(String source, |
| 122 { int radix, | 125 { int radix, |
| 123 int onError(String source) }); | 126 int onError(String source) }); |
| 124 } | 127 } |
| 125 class double extends num {} | 128 class double extends num {} |
| 126 class DateTime extends Object {} | 129 class DateTime extends Object {} |
| 127 class Null extends Object {} | 130 class Null extends Object {} |
| 128 | 131 |
| 129 class Deprecated extends Object { | 132 class Deprecated extends Object { |
| 130 final String expires; | 133 final String expires; |
| 131 const Deprecated(this.expires); | 134 const Deprecated(this.expires); |
| 132 } | 135 } |
| 133 const Object deprecated = const Deprecated("next release"); | 136 const Object deprecated = const Deprecated("next release"); |
| 134 | 137 |
| 135 class Iterator<E> { | 138 class Iterator<E> { |
| 136 bool moveNext(); | 139 bool moveNext(); |
| 137 E get current; | 140 E get current; |
| 138 } | 141 } |
| 139 | 142 |
| 140 abstract class Iterable<E> { | 143 abstract class Iterable<E> { |
| 141 Iterator<E> get iterator; | 144 Iterator<E> get iterator; |
| 142 bool get isEmpty; | 145 bool get isEmpty; |
| 146 E get first; |
| 143 | 147 |
| 144 Iterable/*<R>*/ map/*<R>*/(/*=R*/ f(E e)); | 148 Iterable/*<R>*/ map/*<R>*/(/*=R*/ f(E e)); |
| 145 | 149 |
| 146 /*=R*/ fold/*<R>*/(/*=R*/ initialValue, | 150 /*=R*/ fold/*<R>*/(/*=R*/ initialValue, |
| 147 /*=R*/ combine(/*=R*/ previousValue, E element)); | 151 /*=R*/ combine(/*=R*/ previousValue, E element)); |
| 148 } | 152 } |
| 149 | 153 |
| 150 abstract class List<E> implements Iterable<E> { | 154 abstract class List<E> implements Iterable<E> { |
| 151 void add(E value); | 155 void add(E value); |
| 152 E operator [](int index); | 156 E operator [](int index); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 | 381 |
| 378 @override | 382 @override |
| 379 AnalysisCache createCacheFromSourceFactory(SourceFactory factory) { | 383 AnalysisCache createCacheFromSourceFactory(SourceFactory factory) { |
| 380 if (factory == null) { | 384 if (factory == null) { |
| 381 return super.createCacheFromSourceFactory(factory); | 385 return super.createCacheFromSourceFactory(factory); |
| 382 } | 386 } |
| 383 return new AnalysisCache( | 387 return new AnalysisCache( |
| 384 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); | 388 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); |
| 385 } | 389 } |
| 386 } | 390 } |
| OLD | NEW |