| 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 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 Body, | 482 Body, |
| 483 } | 483 } |
| 484 | 484 |
| 485 /// Declaration of a regular class or a mixin application. | 485 /// Declaration of a regular class or a mixin application. |
| 486 /// | 486 /// |
| 487 /// Mixin applications may not contain fields or procedures, as they implicitly | 487 /// Mixin applications may not contain fields or procedures, as they implicitly |
| 488 /// use those from its mixed-in type. However, the IR does not enforce this | 488 /// use those from its mixed-in type. However, the IR does not enforce this |
| 489 /// rule directly, as doing so can obstruct transformations. It is possible to | 489 /// rule directly, as doing so can obstruct transformations. It is possible to |
| 490 /// transform a mixin application to become a regular class, and vice versa. | 490 /// transform a mixin application to become a regular class, and vice versa. |
| 491 class Class extends NamedNode { | 491 class Class extends NamedNode { |
| 492 /// Offset of the declaration, set and used when writing the binary. |
| 493 int binaryOffset = -1; |
| 494 |
| 492 /// The degree to which the contents of the class have been loaded. | 495 /// The degree to which the contents of the class have been loaded. |
| 493 ClassLevel level = ClassLevel.Body; | 496 ClassLevel level = ClassLevel.Body; |
| 494 | 497 |
| 495 /// List of metadata annotations on the class. | 498 /// List of metadata annotations on the class. |
| 496 /// | 499 /// |
| 497 /// This defaults to an immutable empty list. Use [addAnnotation] to add | 500 /// This defaults to an immutable empty list. Use [addAnnotation] to add |
| 498 /// annotations if needed. | 501 /// annotations if needed. |
| 499 List<Expression> annotations = const <Expression>[]; | 502 List<Expression> annotations = const <Expression>[]; |
| 500 | 503 |
| 501 /// Name of the class. | 504 /// Name of the class. |
| (...skipping 3078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3580 /// For named parameters, this is the name of the parameter. No two named | 3583 /// For named parameters, this is the name of the parameter. No two named |
| 3581 /// parameters (in the same parameter list) can have the same name. | 3584 /// parameters (in the same parameter list) can have the same name. |
| 3582 /// | 3585 /// |
| 3583 /// In all other cases, the name is cosmetic, may be empty or null, | 3586 /// In all other cases, the name is cosmetic, may be empty or null, |
| 3584 /// and is not necessarily unique. | 3587 /// and is not necessarily unique. |
| 3585 String name; | 3588 String name; |
| 3586 int flags = 0; | 3589 int flags = 0; |
| 3587 DartType type; // Not null, defaults to dynamic. | 3590 DartType type; // Not null, defaults to dynamic. |
| 3588 | 3591 |
| 3589 /// Offset of the declaration, set and used when writing the binary. | 3592 /// Offset of the declaration, set and used when writing the binary. |
| 3590 int binaryOffset = -1; | 3593 int binaryOffsetNoTag = -1; |
| 3591 | 3594 |
| 3592 /// For locals, this is the initial value. | 3595 /// For locals, this is the initial value. |
| 3593 /// For parameters, this is the default value. | 3596 /// For parameters, this is the default value. |
| 3594 /// | 3597 /// |
| 3595 /// Should be null in other cases. | 3598 /// Should be null in other cases. |
| 3596 Expression initializer; // May be null. | 3599 Expression initializer; // May be null. |
| 3597 | 3600 |
| 3598 VariableDeclaration(this.name, | 3601 VariableDeclaration(this.name, |
| 3599 {this.initializer, | 3602 {this.initializer, |
| 3600 this.type: const DynamicType(), | 3603 this.type: const DynamicType(), |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4511 /// typedef has not been assigned a canonical name yet. | 4514 /// typedef has not been assigned a canonical name yet. |
| 4512 /// | 4515 /// |
| 4513 /// Returns `null` if the typedef is `null`. | 4516 /// Returns `null` if the typedef is `null`. |
| 4514 CanonicalName getCanonicalNameOfTypedef(Typedef typedef_) { | 4517 CanonicalName getCanonicalNameOfTypedef(Typedef typedef_) { |
| 4515 if (typedef_ == null) return null; | 4518 if (typedef_ == null) return null; |
| 4516 if (typedef_.canonicalName == null) { | 4519 if (typedef_.canonicalName == null) { |
| 4517 throw '$typedef_ has no canonical name'; | 4520 throw '$typedef_ has no canonical name'; |
| 4518 } | 4521 } |
| 4519 return typedef_.canonicalName; | 4522 return typedef_.canonicalName; |
| 4520 } | 4523 } |
| OLD | NEW |