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 /// ----------------------------------------------------------------------- | 5 /// ----------------------------------------------------------------------- |
6 /// ERROR HANDLING | 6 /// ERROR HANDLING |
7 /// ----------------------------------------------------------------------- | 7 /// ----------------------------------------------------------------------- |
8 /// | 8 /// |
9 /// As a rule of thumb, errors that can be detected statically are handled by | 9 /// As a rule of thumb, errors that can be detected statically are handled by |
10 /// the frontend, typically by translating the erroneous code into a 'throw' or | 10 /// the frontend, typically by translating the erroneous code into a 'throw' or |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 } | 235 } |
236 return node as Typedef; | 236 return node as Typedef; |
237 } | 237 } |
238 } | 238 } |
239 | 239 |
240 // ------------------------------------------------------------------------ | 240 // ------------------------------------------------------------------------ |
241 // LIBRARIES and CLASSES | 241 // LIBRARIES and CLASSES |
242 // ------------------------------------------------------------------------ | 242 // ------------------------------------------------------------------------ |
243 | 243 |
244 class Library extends NamedNode implements Comparable<Library> { | 244 class Library extends NamedNode implements Comparable<Library> { |
| 245 /// Offset of the declaration, set and used when writing the binary. |
| 246 int binaryOffset = -1; |
| 247 |
245 /// An import path to this library. | 248 /// An import path to this library. |
246 /// | 249 /// |
247 /// The [Uri] should have the `dart`, `package`, `app`, or `file` scheme. | 250 /// The [Uri] should have the `dart`, `package`, `app`, or `file` scheme. |
248 /// | 251 /// |
249 /// If the URI has the `app` scheme, it is relative to the application root. | 252 /// If the URI has the `app` scheme, it is relative to the application root. |
250 Uri importUri; | 253 Uri importUri; |
251 | 254 |
252 /// The uri of the source file this library was loaded from. | 255 /// The uri of the source file this library was loaded from. |
253 String fileUri; | 256 String fileUri; |
254 | 257 |
(...skipping 4364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4619 /// typedef has not been assigned a canonical name yet. | 4622 /// typedef has not been assigned a canonical name yet. |
4620 /// | 4623 /// |
4621 /// Returns `null` if the typedef is `null`. | 4624 /// Returns `null` if the typedef is `null`. |
4622 CanonicalName getCanonicalNameOfTypedef(Typedef typedef_) { | 4625 CanonicalName getCanonicalNameOfTypedef(Typedef typedef_) { |
4623 if (typedef_ == null) return null; | 4626 if (typedef_ == null) return null; |
4624 if (typedef_.canonicalName == null) { | 4627 if (typedef_.canonicalName == null) { |
4625 throw '$typedef_ has no canonical name'; | 4628 throw '$typedef_ has no canonical name'; |
4626 } | 4629 } |
4627 return typedef_.canonicalName; | 4630 return typedef_.canonicalName; |
4628 } | 4631 } |
OLD | NEW |