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 code_transformers.src.dart_sdk; | 5 library code_transformers.src.dart_sdk; |
6 | 6 |
7 import 'dart:io' show Directory; | 7 import 'dart:io' show Directory; |
8 | 8 |
9 /// Note that the Analyzer has two versions of SdkAnalysisContext (and lots of | 9 /// Note that the Analyzer has two versions of SdkAnalysisContext (and lots of |
10 /// other classes) with different signatures: can't mix the two. | 10 /// other classes) with different signatures: can't mix the two. |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 } | 175 } |
176 } | 176 } |
177 | 177 |
178 class _MockSdkSource implements UriAnnotatedSource { | 178 class _MockSdkSource implements UriAnnotatedSource { |
179 /// Absolute URI which this source can be imported from. | 179 /// Absolute URI which this source can be imported from. |
180 final Uri uri; | 180 final Uri uri; |
181 final String _contents; | 181 final String _contents; |
182 | 182 |
183 Source get source => this; | 183 Source get source => this; |
184 | 184 |
| 185 Source get librarySource => null; |
| 186 |
185 _MockSdkSource(this.uri, this._contents); | 187 _MockSdkSource(this.uri, this._contents); |
186 | 188 |
187 bool exists() => true; | 189 bool exists() => true; |
188 | 190 |
189 int get hashCode => uri.hashCode; | 191 int get hashCode => uri.hashCode; |
190 | 192 |
191 final int modificationStamp = 1; | 193 final int modificationStamp = 1; |
192 | 194 |
193 TimestampedData<String> get contents => | 195 TimestampedData<String> get contents => |
194 new TimestampedData(modificationStamp, _contents); | 196 new TimestampedData(modificationStamp, _contents); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 'dart:async': ''' | 260 'dart:async': ''' |
259 class Future<T> { | 261 class Future<T> { |
260 Future then(callback) {} | 262 Future then(callback) {} |
261 class Stream<T> {} | 263 class Stream<T> {} |
262 ''', | 264 ''', |
263 'dart:html': ''' | 265 'dart:html': ''' |
264 library dart.html; | 266 library dart.html; |
265 class HtmlElement {} | 267 class HtmlElement {} |
266 ''', | 268 ''', |
267 }; | 269 }; |
OLD | NEW |