| 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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 /// Mixin applications may not contain fields or procedures, as they implicitly | 583 /// Mixin applications may not contain fields or procedures, as they implicitly |
| 584 /// use those from its mixed-in type. However, the IR does not enforce this | 584 /// use those from its mixed-in type. However, the IR does not enforce this |
| 585 /// rule directly, as doing so can obstruct transformations. It is possible to | 585 /// rule directly, as doing so can obstruct transformations. It is possible to |
| 586 /// transform a mixin application to become a regular class, and vice versa. | 586 /// transform a mixin application to become a regular class, and vice versa. |
| 587 class Class extends NamedNode { | 587 class Class extends NamedNode { |
| 588 /// End offset in the source file it comes from. Valid values are from 0 and | 588 /// End offset in the source file it comes from. Valid values are from 0 and |
| 589 /// up, or -1 ([TreeNode.noOffset]) if the file end offset is not available | 589 /// up, or -1 ([TreeNode.noOffset]) if the file end offset is not available |
| 590 /// (this is the default if none is specifically set). | 590 /// (this is the default if none is specifically set). |
| 591 int fileEndOffset = TreeNode.noOffset; | 591 int fileEndOffset = TreeNode.noOffset; |
| 592 | 592 |
| 593 /// Offset of the declaration, set and used when writing the binary. | |
| 594 int binaryOffset = -1; | |
| 595 | |
| 596 /// The degree to which the contents of the class have been loaded. | 593 /// The degree to which the contents of the class have been loaded. |
| 597 ClassLevel level = ClassLevel.Body; | 594 ClassLevel level = ClassLevel.Body; |
| 598 | 595 |
| 599 /// Documentation comment of the class, or `null`. | 596 /// Documentation comment of the class, or `null`. |
| 600 @informative | 597 @informative |
| 601 String documentationComment; | 598 String documentationComment; |
| 602 | 599 |
| 603 /// List of metadata annotations on the class. | 600 /// List of metadata annotations on the class. |
| 604 /// | 601 /// |
| 605 /// This defaults to an immutable empty list. Use [addAnnotation] to add | 602 /// This defaults to an immutable empty list. Use [addAnnotation] to add |
| (...skipping 3734 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4340 /// different [FunctionType] objects. | 4337 /// different [FunctionType] objects. |
| 4341 class TypeParameter extends TreeNode { | 4338 class TypeParameter extends TreeNode { |
| 4342 String name; // Cosmetic name. | 4339 String name; // Cosmetic name. |
| 4343 | 4340 |
| 4344 /// The bound on the type variable. | 4341 /// The bound on the type variable. |
| 4345 /// | 4342 /// |
| 4346 /// Should not be null except temporarily during IR construction. Should | 4343 /// Should not be null except temporarily during IR construction. Should |
| 4347 /// be set to the root class for type parameters without an explicit bound. | 4344 /// be set to the root class for type parameters without an explicit bound. |
| 4348 DartType bound; | 4345 DartType bound; |
| 4349 | 4346 |
| 4350 /// Offset of the declaration, set and used when writing the binary. | |
| 4351 int binaryOffset = 0; | |
| 4352 | |
| 4353 TypeParameter([this.name, this.bound]); | 4347 TypeParameter([this.name, this.bound]); |
| 4354 | 4348 |
| 4355 accept(TreeVisitor v) => v.visitTypeParameter(this); | 4349 accept(TreeVisitor v) => v.visitTypeParameter(this); |
| 4356 | 4350 |
| 4357 visitChildren(Visitor v) { | 4351 visitChildren(Visitor v) { |
| 4358 bound.accept(v); | 4352 bound.accept(v); |
| 4359 } | 4353 } |
| 4360 | 4354 |
| 4361 transformChildren(Transformer v) { | 4355 transformChildren(Transformer v) { |
| 4362 bound = v.visitDartType(bound); | 4356 bound = v.visitDartType(bound); |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4691 if (typedef_.canonicalName == null) { | 4685 if (typedef_.canonicalName == null) { |
| 4692 throw '$typedef_ has no canonical name'; | 4686 throw '$typedef_ has no canonical name'; |
| 4693 } | 4687 } |
| 4694 return typedef_.canonicalName; | 4688 return typedef_.canonicalName; |
| 4695 } | 4689 } |
| 4696 | 4690 |
| 4697 /// Annotation describing information which is not part of Dart semantics; in | 4691 /// Annotation describing information which is not part of Dart semantics; in |
| 4698 /// other words, if this information (or any information it refers to) changes, | 4692 /// other words, if this information (or any information it refers to) changes, |
| 4699 /// static analysis and runtime behavior of the library are unaffected. | 4693 /// static analysis and runtime behavior of the library are unaffected. |
| 4700 const informative = null; | 4694 const informative = null; |
| OLD | NEW |