OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 import 'dart:convert'; | 5 import 'dart:convert'; |
6 import 'dart:core' hide Resource; | 6 import 'dart:core' hide Resource; |
7 | 7 |
8 import 'package:analyzer/dart/element/element.dart'; | 8 import 'package:analyzer/dart/element/element.dart'; |
9 import 'package:analyzer/file_system/file_system.dart'; | 9 import 'package:analyzer/file_system/file_system.dart'; |
10 import 'package:analyzer/src/generated/engine.dart'; | 10 import 'package:analyzer/src/generated/engine.dart'; |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 ChunkedConversionSink<Digest> digestSink = | 281 ChunkedConversionSink<Digest> digestSink = |
282 new ChunkedConversionSink<Digest>.withCallback((List<Digest> digests) { | 282 new ChunkedConversionSink<Digest>.withCallback((List<Digest> digests) { |
283 digest = digests.single; | 283 digest = digests.single; |
284 }); | 284 }); |
285 ByteConversionSink byteSink = md5.startChunkedConversion(digestSink); | 285 ByteConversionSink byteSink = md5.startChunkedConversion(digestSink); |
286 // Add data. | 286 // Add data. |
287 addData(byteSink); | 287 addData(byteSink); |
288 byteSink.add(configSalt); | 288 byteSink.add(configSalt); |
289 // Done. | 289 // Done. |
290 byteSink.close(); | 290 byteSink.close(); |
| 291 |
| 292 // TODO(paulberry): this call to `close` should not be needed. |
| 293 // Can be removed once |
| 294 // https://github.com/dart-lang/crypto/issues/33 |
| 295 // is fixed – ensure the min version constraint on crypto is updated, tho. |
| 296 // Does not cause any problems in the mean time. |
| 297 digestSink.close(); |
| 298 |
291 return digest.bytes; | 299 return digest.bytes; |
292 } | 300 } |
293 | 301 |
294 /** | 302 /** |
295 * Return the [AnalysisError] for the given [cachedError]. | 303 * Return the [AnalysisError] for the given [cachedError]. |
296 */ | 304 */ |
297 AnalysisError _convertErrorFromCached( | 305 AnalysisError _convertErrorFromCached( |
298 Source source, CacheAnalysisError cachedError) { | 306 Source source, CacheAnalysisError cachedError) { |
299 ErrorCode errorCode = _getErrorCode(cachedError); | 307 ErrorCode errorCode = _getErrorCode(cachedError); |
300 return new AnalysisError.forValues( | 308 return new AnalysisError.forValues( |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 */ | 541 */ |
534 final String id; | 542 final String id; |
535 | 543 |
536 /** | 544 /** |
537 * The payload bundle. | 545 * The payload bundle. |
538 */ | 546 */ |
539 final PackageBundle bundle; | 547 final PackageBundle bundle; |
540 | 548 |
541 LibraryBundleWithId(this.source, this.id, this.bundle); | 549 LibraryBundleWithId(this.source, this.id, this.bundle); |
542 } | 550 } |
OLD | NEW |