| 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 // TODO(jmesserly): this file needs to be refactored, it's a port from | 5 // TODO(jmesserly): this file needs to be refactored, it's a port from |
| 6 // package:dev_compiler's tests | 6 // package:dev_compiler's tests |
| 7 library analyzer.test.src.task.strong.strong_test_helper; | 7 library analyzer.test.src.task.strong.strong_test_helper; |
| 8 | 8 |
| 9 import 'dart:async'; | 9 import 'dart:async'; |
| 10 | 10 |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 collector.errors = errors; | 338 collector.errors = errors; |
| 339 | 339 |
| 340 var source = unit.source; | 340 var source = unit.source; |
| 341 if (source.uri.scheme == 'dart') { | 341 if (source.uri.scheme == 'dart') { |
| 342 continue; | 342 continue; |
| 343 } | 343 } |
| 344 | 344 |
| 345 var analysisResult = await _resolve(source); | 345 var analysisResult = await _resolve(source); |
| 346 | 346 |
| 347 errors.addAll(analysisResult.errors.where((e) => | 347 errors.addAll(analysisResult.errors.where((e) => |
| 348 // TODO(jmesserly): these are usually intentional dynamic calls. | |
| 349 e.errorCode.name != 'UNDEFINED_METHOD' && | |
| 350 // We don't care about any of these: | 348 // We don't care about any of these: |
| 351 e.errorCode != HintCode.UNUSED_ELEMENT && | 349 e.errorCode != HintCode.UNUSED_ELEMENT && |
| 352 e.errorCode != HintCode.UNUSED_FIELD && | 350 e.errorCode != HintCode.UNUSED_FIELD && |
| 353 e.errorCode != HintCode.UNUSED_IMPORT && | 351 e.errorCode != HintCode.UNUSED_IMPORT && |
| 354 e.errorCode != HintCode.UNUSED_LOCAL_VARIABLE && | 352 e.errorCode != HintCode.UNUSED_LOCAL_VARIABLE && |
| 355 e.errorCode != TodoCode.TODO)); | 353 e.errorCode != TodoCode.TODO)); |
| 356 _expectErrors(analysisOptions, analysisResult.unit, errors); | 354 _expectErrors(analysisOptions, analysisResult.unit, errors); |
| 357 } | 355 } |
| 358 } | 356 } |
| 359 | 357 |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 @override | 472 @override |
| 475 Source resolveAbsolute(Uri uri, [Uri actualUri]) { | 473 Source resolveAbsolute(Uri uri, [Uri actualUri]) { |
| 476 if (uri.scheme == 'package') { | 474 if (uri.scheme == 'package') { |
| 477 return (provider.getResource( | 475 return (provider.getResource( |
| 478 provider.convertPath('/packages/' + uri.path)) as File) | 476 provider.convertPath('/packages/' + uri.path)) as File) |
| 479 .createSource(uri); | 477 .createSource(uri); |
| 480 } | 478 } |
| 481 return super.resolveAbsolute(uri, actualUri); | 479 return super.resolveAbsolute(uri, actualUri); |
| 482 } | 480 } |
| 483 } | 481 } |
| OLD | NEW |