Chromium Code Reviews| 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 library fasta.source_library_builder; | 5 library fasta.source_library_builder; |
| 6 | 6 |
| 7 import 'package:kernel/ast.dart' show | 7 import 'package:kernel/ast.dart' show |
| 8 AsyncMarker, | 8 AsyncMarker, |
| 9 ProcedureKind; | 9 ProcedureKind; |
| 10 | 10 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 117 Unhandled conditionalUris, List<Combinator> combinators) { | 117 Unhandled conditionalUris, List<Combinator> combinators) { |
| 118 loader.read(resolve(uri)).addExporter(this, combinators); | 118 loader.read(resolve(uri)).addExporter(this, combinators); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void addImport(List<MetadataBuilder> metadata, String uri, | 121 void addImport(List<MetadataBuilder> metadata, String uri, |
| 122 Unhandled conditionalUris, String prefix, List<Combinator> combinators, | 122 Unhandled conditionalUris, String prefix, List<Combinator> combinators, |
| 123 bool deferred) { | 123 bool deferred) { |
| 124 imports.add(new Import(loader.read(resolve(uri)), prefix, combinators)); | 124 imports.add(new Import(loader.read(resolve(uri)), prefix, combinators)); |
| 125 } | 125 } |
| 126 | 126 |
| 127 void addPart(List<MetadataBuilder> metadata, String uri) { | 127 void addPart(List<MetadataBuilder> metadata, String path) { |
| 128 parts.add(loader.read(resolve(uri))); | 128 Uri resolvedUri; |
| 129 Uri newFileUri; | |
| 130 if (uri.scheme == "dart") { | |
| 131 resolvedUri = new Uri(scheme: "dart", path: "${uri.path}/$path"); | |
| 132 newFileUri = fileUri.resolve(path); | |
| 133 } else { | |
| 134 newFileUri = resolvedUri = resolve(path); | |
| 135 } | |
| 136 LibraryBuilder part = loader.read(resolvedUri); | |
| 137 if (part is SourceLibraryBuilder) { | |
| 138 if (part.fileUri != null) { | |
|
ahe
2017/02/03 15:41:33
This should be == or part.fileUri ??= newFileUri.
Siggi Cherem (dart-lang)
2017/02/03 18:16:57
Not sure I follow here - what is the underlying is
ahe
2017/02/03 19:34:14
I should set the fileUri if it *is* null. Not when
ahe
2017/02/03 20:03:36
Done.
Siggi Cherem (dart-lang)
2017/02/03 20:25:26
ah - I get it now - your comment was basically a T
ahe
2017/02/03 20:35:44
Yes. As soon as I had sent the comment, I realized
| |
| 139 part.fileUri = newFileUri; | |
| 140 } | |
| 141 } | |
| 142 parts.add(part); | |
| 129 } | 143 } |
| 130 | 144 |
| 131 void addPartOf(List<MetadataBuilder> metadata, String name) { | 145 void addPartOf(List<MetadataBuilder> metadata, String name) { |
| 132 partOf = name; | 146 partOf = name; |
| 133 } | 147 } |
| 134 | 148 |
| 135 ClassBuilder addClass(List<MetadataBuilder> metadata, | 149 ClassBuilder addClass(List<MetadataBuilder> metadata, |
| 136 int modifiers, String name, | 150 int modifiers, String name, |
| 137 List<TypeVariableBuilder> typeVariables, T supertype, | 151 List<TypeVariableBuilder> typeVariables, T supertype, |
| 138 List<T> interfaces); | 152 List<T> interfaces); |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 325 } | 339 } |
| 326 | 340 |
| 327 int resolveConstructors(_) { | 341 int resolveConstructors(_) { |
| 328 int count = 0; | 342 int count = 0; |
| 329 members.forEach((String name, Builder member) { | 343 members.forEach((String name, Builder member) { |
| 330 count += member.resolveConstructors(this); | 344 count += member.resolveConstructors(this); |
| 331 }); | 345 }); |
| 332 return count; | 346 return count; |
| 333 } | 347 } |
| 334 } | 348 } |
| OLD | NEW |