Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 elements.modelx; | 5 library elements.modelx; |
| 6 | 6 |
| 7 import '../common.dart'; | 7 import '../common.dart'; |
| 8 import '../common/names.dart' show Identifiers; | 8 import '../common/names.dart' show Identifiers; |
| 9 import '../common/resolution.dart' show Resolution, ParsingContext; | 9 import '../common/resolution.dart' show Resolution, ParsingContext; |
| 10 import '../compiler.dart' show Compiler; | 10 import '../compiler.dart' show Compiler; |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 773 reporter.reportWarningMessage(tag, MessageKind.DUPLICATED_PART_OF); | 773 reporter.reportWarningMessage(tag, MessageKind.DUPLICATED_PART_OF); |
| 774 return; | 774 return; |
| 775 } | 775 } |
| 776 partTag = tag; | 776 partTag = tag; |
| 777 LibraryName libraryTag = library.libraryTag; | 777 LibraryName libraryTag = library.libraryTag; |
| 778 | 778 |
| 779 Expression libraryReference = tag.name; | 779 Expression libraryReference = tag.name; |
| 780 if (libraryReference is LiteralString) { | 780 if (libraryReference is LiteralString) { |
| 781 // Name is a URI. Resolve and compare to library's URI. | 781 // Name is a URI. Resolve and compare to library's URI. |
| 782 String content = libraryReference.dartString.slowToString(); | 782 String content = libraryReference.dartString.slowToString(); |
| 783 Uri uri = this.script.readableUri.resolve(content); | 783 Uri uri = this.script.readableUri.resolve(content); |
|
Lasse Reichstein Nielsen
2017/05/29 12:46:28
This "readableUri", is that the package URI for a
Johnni Winther
2017/05/29 12:52:31
Yes.
| |
| 784 Uri expectedUri = library.canonicalUri; | 784 Uri expectedUri = library.canonicalUri; |
| 785 if (library.isPlatformLibrary && !uri.isScheme("dart")) { | |
| 786 expectedUri = library.entryCompilationUnit.script.readableUri; | |
|
Johnni Winther
2017/05/29 12:52:31
Add a comment like:
// Allow 'string.dart' to ref
Lasse Reichstein Nielsen
2017/05/29 13:12:03
Done.
| |
| 787 } | |
| 785 if (uri != expectedUri) { | 788 if (uri != expectedUri) { |
| 786 // Consider finding a relative URI reference for the error message. | 789 // Consider finding a relative URI reference for the error message. |
| 787 reporter.reportWarningMessage(tag.name, | 790 reporter.reportWarningMessage(tag.name, |
| 788 MessageKind.LIBRARY_URI_MISMATCH, {'libraryUri': expectedUri}); | 791 MessageKind.LIBRARY_URI_MISMATCH, {'libraryUri': expectedUri}); |
| 789 } | 792 } |
| 790 return; | 793 return; |
| 791 } | 794 } |
| 792 String actualName = tag.name.toString(); | 795 String actualName = tag.name.toString(); |
| 793 if (libraryTag != null) { | 796 if (libraryTag != null) { |
| 794 String expectedName = libraryTag.name.toString(); | 797 String expectedName = libraryTag.name.toString(); |
| (...skipping 2717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3512 body = node.asFunctionExpression().body; | 3515 body = node.asFunctionExpression().body; |
| 3513 } | 3516 } |
| 3514 return new ParsedResolvedAst( | 3517 return new ParsedResolvedAst( |
| 3515 declaration, | 3518 declaration, |
| 3516 node, | 3519 node, |
| 3517 body, | 3520 body, |
| 3518 definingElement.treeElements, | 3521 definingElement.treeElements, |
| 3519 definingElement.compilationUnit.script.resourceUri); | 3522 definingElement.compilationUnit.script.resourceUri); |
| 3520 } | 3523 } |
| 3521 } | 3524 } |
| OLD | NEW |