| 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.class_builder; | 5 library fasta.class_builder; |
| 6 | 6 |
| 7 import '../errors.dart' show internalError; | 7 import '../errors.dart' show internalError; |
| 8 | 8 |
| 9 import 'builder.dart' | 9 import 'builder.dart' |
| 10 show | 10 show |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 Map<String, Builder> get constructors; | 54 Map<String, Builder> get constructors; |
| 55 | 55 |
| 56 Map<String, Builder> get membersInScope => members; | 56 Map<String, Builder> get membersInScope => members; |
| 57 | 57 |
| 58 LibraryBuilder get library { | 58 LibraryBuilder get library { |
| 59 LibraryBuilder library = parent; | 59 LibraryBuilder library = parent; |
| 60 return library.partOfLibrary ?? library; | 60 return library.partOfLibrary ?? library; |
| 61 } | 61 } |
| 62 | 62 |
| 63 @override |
| 63 int resolveConstructors(LibraryBuilder library) { | 64 int resolveConstructors(LibraryBuilder library) { |
| 64 if (constructorReferences == null) return 0; | 65 if (constructorReferences == null) return 0; |
| 65 Scope scope = computeInstanceScope(library.scope); | 66 Scope scope = computeInstanceScope(library.scope); |
| 66 for (ConstructorReferenceBuilder ref in constructorReferences) { | 67 for (ConstructorReferenceBuilder ref in constructorReferences) { |
| 67 ref.resolveIn(scope); | 68 ref.resolveIn(scope); |
| 68 } | 69 } |
| 69 return constructorReferences.length; | 70 return constructorReferences.length; |
| 70 } | 71 } |
| 71 | 72 |
| 72 Scope computeInstanceScope(Scope parent) { | 73 Scope computeInstanceScope(Scope parent) { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 } | 208 } |
| 208 | 209 |
| 209 void addWarning(int charOffset, String message) { | 210 void addWarning(int charOffset, String message) { |
| 210 library.addWarning(charOffset, message, fileUri: fileUri); | 211 library.addWarning(charOffset, message, fileUri: fileUri); |
| 211 } | 212 } |
| 212 | 213 |
| 213 void addNit(int charOffset, String message) { | 214 void addNit(int charOffset, String message) { |
| 214 library.addNit(charOffset, message, fileUri: fileUri); | 215 library.addNit(charOffset, message, fileUri: fileUri); |
| 215 } | 216 } |
| 216 } | 217 } |
| OLD | NEW |