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 3440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3451 int fileEqualsOffset = TreeNode.noOffset; | 3451 int fileEqualsOffset = TreeNode.noOffset; |
3452 | 3452 |
3453 /// For named parameters, this is the name of the parameter. No two named | 3453 /// For named parameters, this is the name of the parameter. No two named |
3454 /// parameters (in the same parameter list) can have the same name. | 3454 /// parameters (in the same parameter list) can have the same name. |
3455 /// | 3455 /// |
3456 /// In all other cases, the name is cosmetic, may be empty or null, | 3456 /// In all other cases, the name is cosmetic, may be empty or null, |
3457 /// and is not necessarily unique. | 3457 /// and is not necessarily unique. |
3458 String name; | 3458 String name; |
3459 int flags = 0; | 3459 int flags = 0; |
3460 DartType type; // Not null, defaults to dynamic. | 3460 DartType type; // Not null, defaults to dynamic. |
3461 int tempOffset; | |
Kevin Millikin (Google)
2017/04/05 08:59:57
Name should be something like binaryOffset.
Comme
| |
3461 | 3462 |
3462 /// For locals, this is the initial value. | 3463 /// For locals, this is the initial value. |
3463 /// For parameters, this is the default value. | 3464 /// For parameters, this is the default value. |
3464 /// | 3465 /// |
3465 /// Should be null in other cases. | 3466 /// Should be null in other cases. |
3466 Expression initializer; // May be null. | 3467 Expression initializer; // May be null. |
3467 | 3468 |
3468 VariableDeclaration(this.name, | 3469 VariableDeclaration(this.name, |
3469 {this.initializer, | 3470 {this.initializer, |
3470 this.type: const DynamicType(), | 3471 this.type: const DynamicType(), |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4232 /// library has not been assigned a canonical name yet. | 4233 /// library has not been assigned a canonical name yet. |
4233 /// | 4234 /// |
4234 /// Returns `null` if the library is `null`. | 4235 /// Returns `null` if the library is `null`. |
4235 CanonicalName getCanonicalNameOfLibrary(Library library) { | 4236 CanonicalName getCanonicalNameOfLibrary(Library library) { |
4236 if (library == null) return null; | 4237 if (library == null) return null; |
4237 if (library.canonicalName == null) { | 4238 if (library.canonicalName == null) { |
4238 throw '$library has no canonical name'; | 4239 throw '$library has no canonical name'; |
4239 } | 4240 } |
4240 return library.canonicalName; | 4241 return library.canonicalName; |
4241 } | 4242 } |
OLD | NEW |