Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(565)

Side by Side Diff: pkg/compiler/lib/src/elements/modelx.dart

Issue 2909043002: Make dart2js understand relative part-of in platform libraries. (Closed)
Patch Set: git cl land Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
784 Uri expectedUri = library.canonicalUri; 784 Uri expectedUri = library.canonicalUri;
785 // Also allow `string.dart` to refer to `dart:core` as `core.dart`.
786 if (library.isPlatformLibrary && !uri.isScheme("dart")) {
787 expectedUri = library.entryCompilationUnit.script.readableUri;
788 }
785 if (uri != expectedUri) { 789 if (uri != expectedUri) {
786 // Consider finding a relative URI reference for the error message. 790 // Consider finding a relative URI reference for the error message.
787 reporter.reportWarningMessage(tag.name, 791 reporter.reportWarningMessage(tag.name,
788 MessageKind.LIBRARY_URI_MISMATCH, {'libraryUri': expectedUri}); 792 MessageKind.LIBRARY_URI_MISMATCH, {'libraryUri': expectedUri});
789 } 793 }
790 return; 794 return;
791 } 795 }
792 String actualName = tag.name.toString(); 796 String actualName = tag.name.toString();
793 if (libraryTag != null) { 797 if (libraryTag != null) {
794 String expectedName = libraryTag.name.toString(); 798 String expectedName = libraryTag.name.toString();
(...skipping 2717 matching lines...) Expand 10 before | Expand all | Expand 10 after
3512 body = node.asFunctionExpression().body; 3516 body = node.asFunctionExpression().body;
3513 } 3517 }
3514 return new ParsedResolvedAst( 3518 return new ParsedResolvedAst(
3515 declaration, 3519 declaration,
3516 node, 3520 node,
3517 body, 3521 body,
3518 definingElement.treeElements, 3522 definingElement.treeElements,
3519 definingElement.compilationUnit.script.resourceUri); 3523 definingElement.compilationUnit.script.resourceUri);
3520 } 3524 }
3521 } 3525 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698