Chromium Code Reviews| 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 1133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1144 /// | 1144 /// |
| 1145 /// This may occur in a procedure, constructor, function expression, or local | 1145 /// This may occur in a procedure, constructor, function expression, or local |
| 1146 /// function declaration. | 1146 /// function declaration. |
| 1147 class FunctionNode extends TreeNode { | 1147 class FunctionNode extends TreeNode { |
| 1148 /// End offset in the source file it comes from. Valid values are from 0 and | 1148 /// End offset in the source file it comes from. Valid values are from 0 and |
| 1149 /// up, or -1 ([TreeNode.noOffset]) if the file end offset is not available | 1149 /// up, or -1 ([TreeNode.noOffset]) if the file end offset is not available |
| 1150 /// (this is the default if none is specifically set). | 1150 /// (this is the default if none is specifically set). |
| 1151 int fileEndOffset = TreeNode.noOffset; | 1151 int fileEndOffset = TreeNode.noOffset; |
| 1152 | 1152 |
| 1153 AsyncMarker asyncMarker; | 1153 AsyncMarker asyncMarker; |
| 1154 bool debuggable = true; | 1154 AsyncMarker originalAsyncMarker; |
|
asgerf
2017/02/17 13:31:30
Could you please add some documentation, explainin
jensj
2017/02/20 09:06:28
Done.
| |
| 1155 List<TypeParameter> typeParameters; | 1155 List<TypeParameter> typeParameters; |
| 1156 int requiredParameterCount; | 1156 int requiredParameterCount; |
| 1157 List<VariableDeclaration> positionalParameters; | 1157 List<VariableDeclaration> positionalParameters; |
| 1158 List<VariableDeclaration> namedParameters; | 1158 List<VariableDeclaration> namedParameters; |
| 1159 InferredValue inferredReturnValue; // May be null. | 1159 InferredValue inferredReturnValue; // May be null. |
| 1160 DartType returnType; // Not null. | 1160 DartType returnType; // Not null. |
| 1161 Statement body; | 1161 Statement body; |
| 1162 | 1162 |
| 1163 FunctionNode(this.body, | 1163 FunctionNode(this.body, |
| 1164 {List<TypeParameter> typeParameters, | 1164 {List<TypeParameter> typeParameters, |
| 1165 List<VariableDeclaration> positionalParameters, | 1165 List<VariableDeclaration> positionalParameters, |
| 1166 List<VariableDeclaration> namedParameters, | 1166 List<VariableDeclaration> namedParameters, |
| 1167 int requiredParameterCount, | 1167 int requiredParameterCount, |
| 1168 this.returnType: const DynamicType(), | 1168 this.returnType: const DynamicType(), |
| 1169 this.inferredReturnValue, | 1169 this.inferredReturnValue, |
| 1170 this.asyncMarker: AsyncMarker.Sync}) | 1170 this.asyncMarker: AsyncMarker.Sync, |
| 1171 this.originalAsyncMarker: AsyncMarker.Sync}) | |
| 1171 : this.positionalParameters = | 1172 : this.positionalParameters = |
| 1172 positionalParameters ?? <VariableDeclaration>[], | 1173 positionalParameters ?? <VariableDeclaration>[], |
| 1173 this.requiredParameterCount = | 1174 this.requiredParameterCount = |
| 1174 requiredParameterCount ?? positionalParameters?.length ?? 0, | 1175 requiredParameterCount ?? positionalParameters?.length ?? 0, |
| 1175 this.namedParameters = namedParameters ?? <VariableDeclaration>[], | 1176 this.namedParameters = namedParameters ?? <VariableDeclaration>[], |
| 1176 this.typeParameters = typeParameters ?? <TypeParameter>[] { | 1177 this.typeParameters = typeParameters ?? <TypeParameter>[] { |
| 1177 assert(returnType != null); | 1178 assert(returnType != null); |
| 1178 setParents(this.typeParameters, this); | 1179 setParents(this.typeParameters, this); |
| 1179 setParents(this.positionalParameters, this); | 1180 setParents(this.positionalParameters, this); |
| 1180 setParents(this.namedParameters, this); | 1181 setParents(this.namedParameters, this); |
| (...skipping 2564 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3745 } | 3746 } |
| 3746 } | 3747 } |
| 3747 } | 3748 } |
| 3748 | 3749 |
| 3749 class Source { | 3750 class Source { |
| 3750 final List<int> lineStarts; | 3751 final List<int> lineStarts; |
| 3751 final String source; | 3752 final String source; |
| 3752 | 3753 |
| 3753 Source(this.lineStarts, this.source); | 3754 Source(this.lineStarts, this.source); |
| 3754 } | 3755 } |
| OLD | NEW |