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 library serialization.summarize_ast; | 5 library serialization.summarize_ast; |
| 6 | 6 |
| 7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
| 8 import 'package:analyzer/dart/ast/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
| 9 import 'package:analyzer/dart/ast/visitor.dart'; | 9 import 'package:analyzer/dart/ast/visitor.dart'; |
| 10 import 'package:analyzer/dart/element/type.dart' show DartType; | 10 import 'package:analyzer/dart/element/type.dart' show DartType; |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 244 * List of objects which should be written to [UnlinkedUnit.parts]. | 244 * List of objects which should be written to [UnlinkedUnit.parts]. |
| 245 */ | 245 */ |
| 246 final List<UnlinkedPartBuilder> parts = <UnlinkedPartBuilder>[]; | 246 final List<UnlinkedPartBuilder> parts = <UnlinkedPartBuilder>[]; |
| 247 | 247 |
| 248 /** | 248 /** |
| 249 * List of objects which should be written to [UnlinkedUnit.typedefs]. | 249 * List of objects which should be written to [UnlinkedUnit.typedefs]. |
| 250 */ | 250 */ |
| 251 final List<UnlinkedTypedefBuilder> typedefs = <UnlinkedTypedefBuilder>[]; | 251 final List<UnlinkedTypedefBuilder> typedefs = <UnlinkedTypedefBuilder>[]; |
| 252 | 252 |
| 253 /** | 253 /** |
| 254 * List of objects which should be written to [UnlinkedUnit.variables], | 254 * List of objects which should be written to [UnlinkedUnit.variables] or |
| 255 * [UnlinkedClass.fields] or [UnlinkedExecutable.localVariables]. | 255 * [UnlinkedClass.fields]. |
| 256 */ | 256 */ |
| 257 List<UnlinkedVariableBuilder> variables = <UnlinkedVariableBuilder>[]; | 257 List<UnlinkedVariableBuilder> variables = <UnlinkedVariableBuilder>[]; |
| 258 | 258 |
| 259 /** | 259 /** |
| 260 * The unlinked portion of the "imports table". This is the list of objects | 260 * The unlinked portion of the "imports table". This is the list of objects |
| 261 * which should be written to [UnlinkedUnit.imports]. | 261 * which should be written to [UnlinkedUnit.imports]. |
| 262 */ | 262 */ |
| 263 final List<UnlinkedImportBuilder> unlinkedImports = <UnlinkedImportBuilder>[]; | 263 final List<UnlinkedImportBuilder> unlinkedImports = <UnlinkedImportBuilder>[]; |
| 264 | 264 |
| 265 /** | 265 /** |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 552 UnlinkedExprBuilder serializeConstExpr( | 552 UnlinkedExprBuilder serializeConstExpr( |
| 553 bool forConst, Map<int, int> localClosureIndexMap, Expression expression, | 553 bool forConst, Map<int, int> localClosureIndexMap, Expression expression, |
| 554 [Set<String> parameterNames]) { | 554 [Set<String> parameterNames]) { |
| 555 _ConstExprSerializer serializer = new _ConstExprSerializer( | 555 _ConstExprSerializer serializer = new _ConstExprSerializer( |
| 556 forConst, this, localClosureIndexMap, parameterNames); | 556 forConst, this, localClosureIndexMap, parameterNames); |
| 557 serializer.serialize(expression); | 557 serializer.serialize(expression); |
| 558 return serializer.toBuilder(); | 558 return serializer.toBuilder(); |
| 559 } | 559 } |
| 560 | 560 |
| 561 /** | 561 /** |
| 562 * Serialize the given [declaredIdentifier] into [UnlinkedVariable], and | |
| 563 * store it in [variables]. | |
| 564 */ | |
| 565 void serializeDeclaredIdentifier( | |
| 566 AstNode scopeNode, | |
| 567 Comment documentationComment, | |
| 568 NodeList<Annotation> annotations, | |
| 569 bool isFinal, | |
| 570 bool isConst, | |
| 571 TypeAnnotation type, | |
| 572 bool assignPropagatedTypeSlot, | |
| 573 SimpleIdentifier declaredIdentifier) { | |
| 574 UnlinkedVariableBuilder b = new UnlinkedVariableBuilder(); | |
| 575 b.isFinal = isFinal; | |
| 576 b.isConst = isConst; | |
| 577 b.name = declaredIdentifier.name; | |
| 578 b.nameOffset = declaredIdentifier.offset; | |
| 579 b.type = serializeTypeName(type); | |
| 580 b.documentationComment = serializeDocumentation(documentationComment); | |
| 581 b.annotations = serializeAnnotations(annotations); | |
| 582 b.codeRange = serializeCodeRange(declaredIdentifier); | |
| 583 if (assignPropagatedTypeSlot) { | |
| 584 b.propagatedTypeSlot = assignSlot(); | |
| 585 } | |
| 586 b.visibleOffset = scopeNode?.offset; | |
| 587 b.visibleLength = scopeNode?.length; | |
| 588 this.variables.add(b); | |
| 589 } | |
| 590 | |
| 591 /** | |
| 592 * Serialize a [Comment] node into an [UnlinkedDocumentationComment] object. | 562 * Serialize a [Comment] node into an [UnlinkedDocumentationComment] object. |
| 593 */ | 563 */ |
| 594 UnlinkedDocumentationCommentBuilder serializeDocumentation( | 564 UnlinkedDocumentationCommentBuilder serializeDocumentation( |
| 595 Comment documentationComment) { | 565 Comment documentationComment) { |
| 596 if (documentationComment == null) { | 566 if (documentationComment == null) { |
| 597 return null; | 567 return null; |
| 598 } | 568 } |
| 599 String text = documentationComment.tokens | 569 String text = documentationComment.tokens |
| 600 .map((Token t) => t.toString()) | 570 .map((Token t) => t.toString()) |
| 601 .join('\n') | 571 .join('\n') |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 727 if (body is BlockFunctionBody || body is ExpressionFunctionBody) { | 697 if (body is BlockFunctionBody || body is ExpressionFunctionBody) { |
| 728 for (UnlinkedParamBuilder parameter in b.parameters) { | 698 for (UnlinkedParamBuilder parameter in b.parameters) { |
| 729 if (!parameter.isInitializingFormal) { | 699 if (!parameter.isInitializingFormal) { |
| 730 parameter.visibleOffset = body.offset; | 700 parameter.visibleOffset = body.offset; |
| 731 parameter.visibleLength = body.length; | 701 parameter.visibleLength = body.length; |
| 732 } | 702 } |
| 733 } | 703 } |
| 734 } | 704 } |
| 735 List<UnlinkedExecutableBuilder> oldExecutables = executables; | 705 List<UnlinkedExecutableBuilder> oldExecutables = executables; |
| 736 List<UnlinkedLabelBuilder> oldLabels = labels; | 706 List<UnlinkedLabelBuilder> oldLabels = labels; |
| 737 List<UnlinkedVariableBuilder> oldVariables = variables; | |
| 738 Map<int, int> oldLocalClosureIndexMap = _localClosureIndexMap; | 707 Map<int, int> oldLocalClosureIndexMap = _localClosureIndexMap; |
| 739 bool oldSerializeClosureBodyExprs = _serializeClosureBodyExprs; | 708 bool oldSerializeClosureBodyExprs = _serializeClosureBodyExprs; |
| 740 executables = <UnlinkedExecutableBuilder>[]; | 709 executables = <UnlinkedExecutableBuilder>[]; |
| 741 labels = <UnlinkedLabelBuilder>[]; | 710 labels = <UnlinkedLabelBuilder>[]; |
| 742 variables = <UnlinkedVariableBuilder>[]; | |
| 743 _localClosureIndexMap = <int, int>{}; | 711 _localClosureIndexMap = <int, int>{}; |
| 744 _serializeClosureBodyExprs = serializeBodyExpr; | 712 _serializeClosureBodyExprs = serializeBodyExpr; |
| 745 if (initializers != null) { | 713 if (initializers != null) { |
| 746 for (ConstructorInitializer initializer in initializers) { | 714 for (ConstructorInitializer initializer in initializers) { |
| 747 initializer.accept(this); | 715 initializer.accept(this); |
| 748 } | 716 } |
| 749 } | 717 } |
| 750 if (serializeBody) { | 718 if (serializeBody) { |
| 751 body.accept(this); | 719 body.accept(this); |
| 752 } | 720 } |
| 753 if (serializeBodyExpr) { | 721 if (serializeBodyExpr) { |
| 754 if (body is Expression) { | 722 if (body is Expression) { |
| 755 b.bodyExpr = serializeConstExpr( | 723 b.bodyExpr = serializeConstExpr( |
| 756 forConst, _localClosureIndexMap, body, _parameterNames); | 724 forConst, _localClosureIndexMap, body, _parameterNames); |
| 757 } else if (body is ExpressionFunctionBody) { | 725 } else if (body is ExpressionFunctionBody) { |
| 758 b.bodyExpr = serializeConstExpr( | 726 b.bodyExpr = serializeConstExpr( |
| 759 forConst, _localClosureIndexMap, body.expression, _parameterNames); | 727 forConst, _localClosureIndexMap, body.expression, _parameterNames); |
| 760 } else { | 728 } else { |
| 761 // TODO(paulberry): serialize other types of function bodies. | 729 // TODO(paulberry): serialize other types of function bodies. |
| 762 } | 730 } |
| 763 } | 731 } |
| 764 b.localFunctions = executables; | 732 b.localFunctions = executables; |
| 765 b.localLabels = labels; | 733 b.localLabels = labels; |
| 766 b.localVariables = variables; | |
| 767 Map<int, int> localClosureIndexMap = _localClosureIndexMap; | 734 Map<int, int> localClosureIndexMap = _localClosureIndexMap; |
| 768 executables = oldExecutables; | 735 executables = oldExecutables; |
| 769 labels = oldLabels; | 736 labels = oldLabels; |
| 770 variables = oldVariables; | |
| 771 _localClosureIndexMap = oldLocalClosureIndexMap; | 737 _localClosureIndexMap = oldLocalClosureIndexMap; |
| 772 _serializeClosureBodyExprs = oldSerializeClosureBodyExprs; | 738 _serializeClosureBodyExprs = oldSerializeClosureBodyExprs; |
| 773 return localClosureIndexMap; | 739 return localClosureIndexMap; |
| 774 } | 740 } |
| 775 | 741 |
| 776 /** | 742 /** |
| 777 * Serialize the return type and parameters of a function-typed formal | 743 * Serialize the return type and parameters of a function-typed formal |
| 778 * parameter and store them in [b]. | 744 * parameter and store them in [b]. |
| 779 */ | 745 */ |
| 780 void serializeFunctionTypedParameterDetails(UnlinkedParamBuilder b, | 746 void serializeFunctionTypedParameterDetails(UnlinkedParamBuilder b, |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 995 return typeParameters.typeParameters.map(visitTypeParameter).toList(); | 961 return typeParameters.typeParameters.map(visitTypeParameter).toList(); |
| 996 } | 962 } |
| 997 return const <UnlinkedTypeParamBuilder>[]; | 963 return const <UnlinkedTypeParamBuilder>[]; |
| 998 } | 964 } |
| 999 | 965 |
| 1000 /** | 966 /** |
| 1001 * Serialize the given [variables] into [UnlinkedVariable]s, and store them | 967 * Serialize the given [variables] into [UnlinkedVariable]s, and store them |
| 1002 * in [this.variables]. | 968 * in [this.variables]. |
| 1003 */ | 969 */ |
| 1004 void serializeVariables( | 970 void serializeVariables( |
| 1005 AstNode scopeNode, | |
| 1006 VariableDeclarationList variables, | 971 VariableDeclarationList variables, |
| 1007 bool isDeclaredStatic, | 972 bool isDeclaredStatic, |
| 1008 Comment documentationComment, | 973 Comment documentationComment, |
| 1009 NodeList<Annotation> annotations, | 974 NodeList<Annotation> annotations, |
| 1010 bool isField) { | 975 bool isField) { |
| 1011 bool isCovariant = isField | 976 bool isCovariant = isField |
| 1012 ? (variables.parent as FieldDeclaration).covariantKeyword != null | 977 ? (variables.parent as FieldDeclaration).covariantKeyword != null |
| 1013 : false; | 978 : false; |
| 1014 for (VariableDeclaration variable in variables.variables) { | 979 for (VariableDeclaration variable in variables.variables) { |
| 1015 UnlinkedVariableBuilder b = new UnlinkedVariableBuilder(); | 980 UnlinkedVariableBuilder b = new UnlinkedVariableBuilder(); |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 1033 } | 998 } |
| 1034 if (variable.initializer != null && | 999 if (variable.initializer != null && |
| 1035 (variables.isFinal || variables.isConst)) { | 1000 (variables.isFinal || variables.isConst)) { |
| 1036 b.propagatedTypeSlot = assignSlot(); | 1001 b.propagatedTypeSlot = assignSlot(); |
| 1037 } | 1002 } |
| 1038 bool isSemanticallyStatic = !isField || isDeclaredStatic; | 1003 bool isSemanticallyStatic = !isField || isDeclaredStatic; |
| 1039 if (variables.type == null && | 1004 if (variables.type == null && |
| 1040 (variable.initializer != null || !isSemanticallyStatic)) { | 1005 (variable.initializer != null || !isSemanticallyStatic)) { |
| 1041 b.inferredTypeSlot = assignSlot(); | 1006 b.inferredTypeSlot = assignSlot(); |
| 1042 } | 1007 } |
| 1043 b.visibleOffset = scopeNode?.offset; | |
| 1044 b.visibleLength = scopeNode?.length; | |
| 1045 this.variables.add(b); | 1008 this.variables.add(b); |
| 1046 } | 1009 } |
| 1047 } | 1010 } |
| 1048 | 1011 |
| 1049 @override | 1012 @override |
| 1050 void visitBlock(Block node) { | 1013 void visitBlock(Block node) { |
| 1051 Block oldBlock = enclosingBlock; | 1014 Block oldBlock = enclosingBlock; |
| 1052 enclosingBlock = node; | 1015 enclosingBlock = node; |
| 1053 super.visitBlock(node); | 1016 super.visitBlock(node); |
| 1054 enclosingBlock = oldBlock; | 1017 enclosingBlock = oldBlock; |
| 1055 } | 1018 } |
| 1056 | 1019 |
| 1057 @override | 1020 @override |
| 1058 void visitCatchClause(CatchClause node) { | |
| 1059 SimpleIdentifier exception = node.exceptionParameter; | |
| 1060 SimpleIdentifier st = node.stackTraceParameter; | |
| 1061 if (exception != null) { | |
| 1062 serializeDeclaredIdentifier( | |
| 1063 node, null, null, false, false, node.exceptionType, false, exception); | |
| 1064 } | |
| 1065 if (st != null) { | |
| 1066 serializeDeclaredIdentifier( | |
| 1067 node, null, null, false, false, null, false, st); | |
| 1068 } | |
| 1069 super.visitCatchClause(node); | |
| 1070 } | |
| 1071 | |
| 1072 @override | |
| 1073 void visitClassDeclaration(ClassDeclaration node) { | 1021 void visitClassDeclaration(ClassDeclaration node) { |
| 1074 TypeName superclass = | 1022 TypeName superclass = |
| 1075 node.extendsClause == null ? null : node.extendsClause.superclass; | 1023 node.extendsClause == null ? null : node.extendsClause.superclass; |
| 1076 serializeClass( | 1024 serializeClass( |
| 1077 node, | 1025 node, |
| 1078 node.abstractKeyword, | 1026 node.abstractKeyword, |
| 1079 node.name.name, | 1027 node.name.name, |
| 1080 node.name.offset, | 1028 node.name.offset, |
| 1081 node.typeParameters, | 1029 node.typeParameters, |
| 1082 superclass, | 1030 superclass, |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1200 @override | 1148 @override |
| 1201 void visitExportDirective(ExportDirective node) { | 1149 void visitExportDirective(ExportDirective node) { |
| 1202 UnlinkedExportNonPublicBuilder b = new UnlinkedExportNonPublicBuilder( | 1150 UnlinkedExportNonPublicBuilder b = new UnlinkedExportNonPublicBuilder( |
| 1203 uriOffset: node.uri.offset, uriEnd: node.uri.end, offset: node.offset); | 1151 uriOffset: node.uri.offset, uriEnd: node.uri.end, offset: node.offset); |
| 1204 b.annotations = serializeAnnotations(node.metadata); | 1152 b.annotations = serializeAnnotations(node.metadata); |
| 1205 exports.add(b); | 1153 exports.add(b); |
| 1206 } | 1154 } |
| 1207 | 1155 |
| 1208 @override | 1156 @override |
| 1209 void visitFieldDeclaration(FieldDeclaration node) { | 1157 void visitFieldDeclaration(FieldDeclaration node) { |
| 1210 serializeVariables(null, node.fields, node.staticKeyword != null, | 1158 serializeVariables(node.fields, node.staticKeyword != null, |
| 1211 node.documentationComment, node.metadata, true); | 1159 node.documentationComment, node.metadata, true); |
| 1212 } | 1160 } |
| 1213 | 1161 |
| 1214 @override | 1162 @override |
| 1215 UnlinkedParamBuilder visitFieldFormalParameter(FieldFormalParameter node) { | 1163 UnlinkedParamBuilder visitFieldFormalParameter(FieldFormalParameter node) { |
| 1216 UnlinkedParamBuilder b = serializeParameter(node); | 1164 UnlinkedParamBuilder b = serializeParameter(node); |
| 1217 b.isInitializingFormal = true; | 1165 b.isInitializingFormal = true; |
| 1218 if (node.type != null || node.parameters != null) { | 1166 if (node.type != null || node.parameters != null) { |
| 1219 b.isFunctionTyped = node.parameters != null; | 1167 b.isFunctionTyped = node.parameters != null; |
| 1220 if (node.parameters != null) { | 1168 if (node.parameters != null) { |
| 1221 serializeFunctionTypedParameterDetails(b, node.type, node.parameters); | 1169 serializeFunctionTypedParameterDetails(b, node.type, node.parameters); |
| 1222 } else { | 1170 } else { |
| 1223 b.type = serializeTypeName(node.type); | 1171 b.type = serializeTypeName(node.type); |
| 1224 } | 1172 } |
| 1225 } | 1173 } |
| 1226 return b; | 1174 return b; |
| 1227 } | 1175 } |
| 1228 | 1176 |
| 1229 @override | 1177 @override |
| 1230 void visitForEachStatement(ForEachStatement node) { | |
| 1231 DeclaredIdentifier loopVariable = node.loopVariable; | |
| 1232 if (loopVariable != null) { | |
| 1233 serializeDeclaredIdentifier( | |
| 1234 node, | |
| 1235 loopVariable.documentationComment, | |
| 1236 loopVariable.metadata, | |
| 1237 loopVariable.isFinal, | |
| 1238 loopVariable.isConst, | |
| 1239 loopVariable.type, | |
| 1240 true, | |
| 1241 loopVariable.identifier); | |
| 1242 } | |
| 1243 super.visitForEachStatement(node); | |
| 1244 } | |
| 1245 | |
| 1246 @override | |
| 1247 void visitForStatement(ForStatement node) { | |
| 1248 VariableDeclarationList declaredVariables = node.variables; | |
| 1249 if (declaredVariables != null) { | |
| 1250 serializeVariables(node, declaredVariables, false, null, null, false); | |
| 1251 } | |
| 1252 super.visitForStatement(node); | |
| 1253 } | |
| 1254 | |
| 1255 @override | |
| 1256 void visitFunctionDeclaration(FunctionDeclaration node) { | 1178 void visitFunctionDeclaration(FunctionDeclaration node) { |
| 1257 executables.add(serializeExecutable( | 1179 executables.add(serializeExecutable( |
| 1258 node, | 1180 node, |
| 1259 node.name.name, | 1181 node.name.name, |
| 1260 node.name.offset, | 1182 node.name.offset, |
| 1261 node.isGetter, | 1183 node.isGetter, |
| 1262 node.isSetter, | 1184 node.isSetter, |
| 1263 node.returnType, | 1185 node.returnType, |
| 1264 node.functionExpression.parameters, | 1186 node.functionExpression.parameters, |
| 1265 node.functionExpression.body, | 1187 node.functionExpression.body, |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1443 | 1365 |
| 1444 @override | 1366 @override |
| 1445 UnlinkedParamBuilder visitSimpleFormalParameter(SimpleFormalParameter node) { | 1367 UnlinkedParamBuilder visitSimpleFormalParameter(SimpleFormalParameter node) { |
| 1446 UnlinkedParamBuilder b = serializeParameter(node); | 1368 UnlinkedParamBuilder b = serializeParameter(node); |
| 1447 b.type = serializeTypeName(node.type); | 1369 b.type = serializeTypeName(node.type); |
| 1448 return b; | 1370 return b; |
| 1449 } | 1371 } |
| 1450 | 1372 |
| 1451 @override | 1373 @override |
| 1452 void visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { | 1374 void visitTopLevelVariableDeclaration(TopLevelVariableDeclaration node) { |
| 1453 serializeVariables(null, node.variables, false, node.documentationComment, | 1375 serializeVariables( |
| 1454 node.metadata, false); | 1376 node.variables, false, node.documentationComment, node.metadata, false); |
| 1455 } | 1377 } |
| 1456 | 1378 |
| 1457 @override | 1379 @override |
| 1458 UnlinkedTypeParamBuilder visitTypeParameter(TypeParameter node) { | 1380 UnlinkedTypeParamBuilder visitTypeParameter(TypeParameter node) { |
| 1459 UnlinkedTypeParamBuilder b = new UnlinkedTypeParamBuilder(); | 1381 UnlinkedTypeParamBuilder b = new UnlinkedTypeParamBuilder(); |
| 1460 b.name = node.name.name; | 1382 b.name = node.name.name; |
| 1461 b.nameOffset = node.name.offset; | 1383 b.nameOffset = node.name.offset; |
| 1462 if (node.bound != null) { | 1384 if (node.bound != null) { |
| 1463 b.bound = serializeTypeName(node.bound); | 1385 b.bound = serializeTypeName(node.bound); |
| 1464 } | 1386 } |
| 1465 b.annotations = serializeAnnotations(node.metadata); | 1387 b.annotations = serializeAnnotations(node.metadata); |
| 1466 b.codeRange = serializeCodeRange(node); | 1388 b.codeRange = serializeCodeRange(node); |
| 1467 return b; | 1389 return b; |
| 1468 } | 1390 } |
| 1469 | 1391 |
| 1470 @override | 1392 @override |
| 1471 void visitVariableDeclarationStatement(VariableDeclarationStatement node) { | 1393 void visitVariableDeclarationStatement(VariableDeclarationStatement node) { |
| 1472 serializeVariables( | 1394 // serializeVariables(node.variables, false, null, null, false); |
|
Paul Berry
2017/06/29 21:34:33
Should we just remove this override entirely?
scheglov
2017/06/29 21:39:54
We cannot do this.
If there are function expressio
| |
| 1473 enclosingBlock, node.variables, false, null, null, false); | |
| 1474 } | 1395 } |
| 1475 | 1396 |
| 1476 /** | 1397 /** |
| 1477 * Compute the API signature of the unit and record it. | 1398 * Compute the API signature of the unit and record it. |
| 1478 */ | 1399 */ |
| 1479 static void _computeApiSignature(UnlinkedUnitBuilder b) { | 1400 static void _computeApiSignature(UnlinkedUnitBuilder b) { |
| 1480 ApiSignature apiSignature = new ApiSignature(); | 1401 ApiSignature apiSignature = new ApiSignature(); |
| 1481 b.collectApiSignature(apiSignature); | 1402 b.collectApiSignature(apiSignature); |
| 1482 b.apiSignature = apiSignature.toByteList(); | 1403 b.apiSignature = apiSignature.toByteList(); |
| 1483 } | 1404 } |
| 1484 } | 1405 } |
| 1485 | 1406 |
| 1486 /** | 1407 /** |
| 1487 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. | 1408 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. |
| 1488 */ | 1409 */ |
| 1489 class _TypeParameterScope extends _Scope { | 1410 class _TypeParameterScope extends _Scope { |
| 1490 /** | 1411 /** |
| 1491 * Get the number of [_ScopedTypeParameter]s defined in this | 1412 * Get the number of [_ScopedTypeParameter]s defined in this |
| 1492 * [_TypeParameterScope]. | 1413 * [_TypeParameterScope]. |
| 1493 */ | 1414 */ |
| 1494 int get length => _definedNames.length; | 1415 int get length => _definedNames.length; |
| 1495 } | 1416 } |
| OLD | NEW |