| 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.kernel_library_builder; | 5 library fasta.kernel_library_builder; |
| 6 | 6 |
| 7 import 'package:front_end/src/fasta/scanner/token.dart' show Token; | 7 import 'package:front_end/src/fasta/scanner/token.dart' show Token; |
| 8 | 8 |
| 9 import 'package:kernel/ast.dart'; | 9 import 'package:kernel/ast.dart'; |
| 10 | 10 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 modifiers, mixinApplication, interfaces, this, charOffset); | 158 modifiers, mixinApplication, interfaces, this, charOffset); |
| 159 // Nested declaration began in `OutlineBuilder.beginNamedMixinApplication`. | 159 // Nested declaration began in `OutlineBuilder.beginNamedMixinApplication`. |
| 160 endNestedDeclaration().resolveTypes(typeVariables, this); | 160 endNestedDeclaration().resolveTypes(typeVariables, this); |
| 161 addBuilder(name, builder, charOffset); | 161 addBuilder(name, builder, charOffset); |
| 162 } | 162 } |
| 163 | 163 |
| 164 void addField(List<MetadataBuilder> metadata, int modifiers, | 164 void addField(List<MetadataBuilder> metadata, int modifiers, |
| 165 KernelTypeBuilder type, String name, int charOffset, Token initializer) { | 165 KernelTypeBuilder type, String name, int charOffset, Token initializer) { |
| 166 addBuilder( | 166 addBuilder( |
| 167 name, | 167 name, |
| 168 new KernelFieldBuilder(loader.astFactory, loader.topLevelTypeInferrer, | 168 new KernelFieldBuilder(loader.astFactory, loader.typeInferenceEngine, |
| 169 metadata, type, name, modifiers, this, charOffset, initializer), | 169 metadata, type, name, modifiers, this, charOffset, initializer), |
| 170 charOffset); | 170 charOffset); |
| 171 } | 171 } |
| 172 | 172 |
| 173 String computeAndValidateConstructorName(String name, int charOffset) { | 173 String computeAndValidateConstructorName(String name, int charOffset) { |
| 174 String className = currentDeclaration.name; | 174 String className = currentDeclaration.name; |
| 175 bool startsWithClassName = name.startsWith(className); | 175 bool startsWithClassName = name.startsWith(className); |
| 176 if (startsWithClassName && name.length == className.length) { | 176 if (startsWithClassName && name.length == className.length) { |
| 177 // Unnamed constructor or factory. | 177 // Unnamed constructor or factory. |
| 178 return ""; | 178 return ""; |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 } | 541 } |
| 542 | 542 |
| 543 @override | 543 @override |
| 544 void includePart(covariant KernelLibraryBuilder part) { | 544 void includePart(covariant KernelLibraryBuilder part) { |
| 545 super.includePart(part); | 545 super.includePart(part); |
| 546 nativeMethods.addAll(part.nativeMethods); | 546 nativeMethods.addAll(part.nativeMethods); |
| 547 boundlessTypeVariables.addAll(part.boundlessTypeVariables); | 547 boundlessTypeVariables.addAll(part.boundlessTypeVariables); |
| 548 assert(mixinApplicationClasses.isEmpty); | 548 assert(mixinApplicationClasses.isEmpty); |
| 549 } | 549 } |
| 550 } | 550 } |
| OLD | NEW |