OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 /// Common logic needed to provide a Dart SDK to the analyzer's resolver. This | 5 /// Common logic needed to provide a Dart SDK to the analyzer's resolver. This |
6 /// includes logic to determine where the sdk is located in the filesystem, and | 6 /// includes logic to determine where the sdk is located in the filesystem, and |
7 /// definitions to provide mock sdks. | 7 /// definitions to provide mock sdks. |
8 library dev_compiler.src.dart_sdk; | 8 library dev_compiler.src.dart_sdk; |
9 | 9 |
10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart' show AnalysisContext, Timest
ampedData; |
11 import 'package:analyzer/src/generated/sdk.dart'; | 11 import 'package:analyzer/src/generated/sdk.dart'; |
12 import 'package:analyzer/src/generated/source.dart'; | 12 import 'package:analyzer/src/generated/source.dart'; |
| 13 import 'package:analyzer/src/context/context.dart'; |
13 | 14 |
14 /// Dart SDK which contains a mock implementation of the SDK libraries. May be | 15 /// Dart SDK which contains a mock implementation of the SDK libraries. May be |
15 /// used to speed up execution when most of the core libraries is not needed. | 16 /// used to speed up execution when most of the core libraries is not needed. |
16 class MockDartSdk implements DartSdk { | 17 class MockDartSdk implements DartSdk { |
17 final Map<Uri, _MockSdkSource> _sources = {}; | 18 final Map<Uri, _MockSdkSource> _sources = {}; |
18 final bool reportMissing; | 19 final bool reportMissing; |
19 final Map<String, SdkLibrary> _libs = {}; | 20 final Map<String, SdkLibrary> _libs = {}; |
20 final String sdkVersion = '0'; | 21 final String sdkVersion = '0'; |
21 List<String> get uris => _sources.keys.map((uri) => '$uri').toList(); | 22 List<String> get uris => _sources.keys.map((uri) => '$uri').toList(); |
22 final AnalysisContext context = new SdkAnalysisContext(); | 23 final AnalysisContext context = new SdkAnalysisContext(); |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 ''', | 173 ''', |
173 'dart:math': ''' | 174 'dart:math': ''' |
174 library dart.math; | 175 library dart.math; |
175 class Random { | 176 class Random { |
176 bool nextBool() {} | 177 bool nextBool() {} |
177 } | 178 } |
178 num min(num x, num y) {} | 179 num min(num x, num y) {} |
179 num max(num x, num y) {} | 180 num max(num x, num y) {} |
180 ''', | 181 ''', |
181 }; | 182 }; |
OLD | NEW |