| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 const _MockSdkLibrary _LIB_CORE = const _MockSdkLibrary( | 113 const _MockSdkLibrary _LIB_CORE = const _MockSdkLibrary( |
| 114 'dart:core', | 114 'dart:core', |
| 115 '$sdkRoot/lib/core/core.dart', | 115 '$sdkRoot/lib/core/core.dart', |
| 116 ''' | 116 ''' |
| 117 library dart.core; | 117 library dart.core; |
| 118 | 118 |
| 119 import 'dart:async'; | 119 import 'dart:async'; |
| 120 | 120 |
| 121 class Object { | 121 class Object { |
| 122 const Object() {} |
| 122 bool operator ==(other) => identical(this, other); | 123 bool operator ==(other) => identical(this, other); |
| 123 String toString() => 'a string'; | 124 String toString() => 'a string'; |
| 124 int get hashCode => 0; | 125 int get hashCode => 0; |
| 125 Type get runtimeType => null; | 126 Type get runtimeType => null; |
| 126 dynamic noSuchMethod(Invocation invocation) => null; | 127 dynamic noSuchMethod(Invocation invocation) => null; |
| 127 } | 128 } |
| 128 | 129 |
| 129 class Function {} | 130 class Function {} |
| 130 class StackTrace {} | 131 class StackTrace {} |
| 131 | 132 |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 const _MockSdkLibrary _LIB_MATH = const _MockSdkLibrary( | 355 const _MockSdkLibrary _LIB_MATH = const _MockSdkLibrary( |
| 355 'dart:math', | 356 'dart:math', |
| 356 '$sdkRoot/lib/math/math.dart', | 357 '$sdkRoot/lib/math/math.dart', |
| 357 ''' | 358 ''' |
| 358 library dart.math; | 359 library dart.math; |
| 359 | 360 |
| 360 const double E = 2.718281828459045; | 361 const double E = 2.718281828459045; |
| 361 const double PI = 3.1415926535897932; | 362 const double PI = 3.1415926535897932; |
| 362 const double LN10 = 2.302585092994046; | 363 const double LN10 = 2.302585092994046; |
| 363 | 364 |
| 364 num/*=T*/ min/*<T extends num>*/(num/*=T*/ a, num/*=T*/ b) => null; | 365 T min<T extends num>(T a, T b) => null; |
| 365 num/*=T*/ max/*<T extends num>*/(num/*=T*/ a, num/*=T*/ b) => null; | 366 T max<T extends num>(T a, T b) => null; |
| 366 | 367 |
| 367 external double cos(num x); | 368 external double cos(num x); |
| 368 external double sin(num x); | 369 external double sin(num x); |
| 369 external double sqrt(num x); | 370 external double sqrt(num x); |
| 370 class Random { | 371 class Random { |
| 371 bool nextBool() => true; | 372 bool nextBool() => true; |
| 372 double nextDouble() => 2.0; | 373 double nextDouble() => 2.0; |
| 373 int nextInt() => 1; | 374 int nextInt() => 1; |
| 374 } | 375 } |
| 375 '''); | 376 '''); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 | 607 |
| 607 @override | 608 @override |
| 608 AnalysisCache createCacheFromSourceFactory(SourceFactory factory) { | 609 AnalysisCache createCacheFromSourceFactory(SourceFactory factory) { |
| 609 if (factory == null) { | 610 if (factory == null) { |
| 610 return super.createCacheFromSourceFactory(factory); | 611 return super.createCacheFromSourceFactory(factory); |
| 611 } | 612 } |
| 612 return new AnalysisCache( | 613 return new AnalysisCache( |
| 613 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); | 614 <CachePartition>[AnalysisEngine.instance.partitionManager.forSdk(sdk)]); |
| 614 } | 615 } |
| 615 } | 616 } |
| OLD | NEW |