| 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 /** | 5 /** |
| 6 * This library is capable of producing linked summaries from unlinked | 6 * This library is capable of producing linked summaries from unlinked |
| 7 * ones (or prelinked ones). It functions by building a miniature | 7 * ones (or prelinked ones). It functions by building a miniature |
| 8 * element model to represent the contents of the summaries, and then | 8 * element model to represent the contents of the summaries, and then |
| 9 * scanning the element model to gather linked information and adding | 9 * scanning the element model to gather linked information and adding |
| 10 * it to the summary data structures. | 10 * it to the summary data structures. |
| (...skipping 3502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3513 | 3513 |
| 3514 @override | 3514 @override |
| 3515 List<UnitElement> get units { | 3515 List<UnitElement> get units { |
| 3516 if (_units == null) { | 3516 if (_units == null) { |
| 3517 UnlinkedUnit definingUnit = definingUnlinkedUnit; | 3517 UnlinkedUnit definingUnit = definingUnlinkedUnit; |
| 3518 _units = <UnitElement>[ | 3518 _units = <UnitElement>[ |
| 3519 _makeUnitElement(definingUnit, 0, _absoluteUri.toString()) | 3519 _makeUnitElement(definingUnit, 0, _absoluteUri.toString()) |
| 3520 ]; | 3520 ]; |
| 3521 int numParts = definingUnit.parts.length; | 3521 int numParts = definingUnit.parts.length; |
| 3522 for (int i = 0; i < numParts; i++) { | 3522 for (int i = 0; i < numParts; i++) { |
| 3523 // TODO(paulberry): make sure we handle the case where | |
| 3524 // resolveRelativeUri fails. | |
| 3525 String partRelativeUriStr = definingUnit.publicNamespace.parts[i]; | 3523 String partRelativeUriStr = definingUnit.publicNamespace.parts[i]; |
| 3526 | 3524 |
| 3525 if (partRelativeUriStr.isEmpty) { |
| 3526 continue; |
| 3527 } |
| 3528 |
| 3527 Uri partRelativeUri; | 3529 Uri partRelativeUri; |
| 3528 try { | 3530 try { |
| 3529 partRelativeUri = Uri.parse(partRelativeUriStr); | 3531 partRelativeUri = Uri.parse(partRelativeUriStr); |
| 3530 } on FormatException { | 3532 } on FormatException { |
| 3531 continue; | 3533 continue; |
| 3532 } | 3534 } |
| 3533 | 3535 |
| 3534 String partAbsoluteUri = | 3536 String partAbsoluteUri = |
| 3535 resolveRelativeUri(_absoluteUri, partRelativeUri).toString(); | 3537 resolveRelativeUri(_absoluteUri, partRelativeUri).toString(); |
| 3536 UnlinkedUnit partUnit = _linker.getUnit(partAbsoluteUri); | 3538 UnlinkedUnit partUnit = _linker.getUnit(partAbsoluteUri); |
| (...skipping 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5294 } | 5296 } |
| 5295 | 5297 |
| 5296 /** | 5298 /** |
| 5297 * This exception is thrown when [ExprTypeComputer] cannot inference the type. | 5299 * This exception is thrown when [ExprTypeComputer] cannot inference the type. |
| 5298 */ | 5300 */ |
| 5299 class _InferenceFailedError { | 5301 class _InferenceFailedError { |
| 5300 final String message; | 5302 final String message; |
| 5301 | 5303 |
| 5302 _InferenceFailedError(this.message); | 5304 _InferenceFailedError(this.message); |
| 5303 } | 5305 } |
| OLD | NEW |