Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(688)

Side by Side Diff: pkg/analyzer/lib/src/summary/summarize_ast.dart

Issue 1839643003: Fixes for AST summary generation when variables are missing. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/in_summary_source_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/src/generated/utilities_dart.dart'; 10 import 'package:analyzer/src/generated/utilities_dart.dart';
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 Block oldBlock = enclosingBlock; 851 Block oldBlock = enclosingBlock;
852 enclosingBlock = node; 852 enclosingBlock = node;
853 super.visitBlock(node); 853 super.visitBlock(node);
854 enclosingBlock = oldBlock; 854 enclosingBlock = oldBlock;
855 } 855 }
856 856
857 @override 857 @override
858 void visitCatchClause(CatchClause node) { 858 void visitCatchClause(CatchClause node) {
859 SimpleIdentifier exception = node.exceptionParameter; 859 SimpleIdentifier exception = node.exceptionParameter;
860 SimpleIdentifier st = node.stackTraceParameter; 860 SimpleIdentifier st = node.stackTraceParameter;
861 serializeDeclaredIdentifier( 861 if (exception != null) {
862 node, null, null, false, false, node.exceptionType, false, exception); 862 serializeDeclaredIdentifier(
863 node, null, null, false, false, node.exceptionType, false, exception);
864 }
863 if (st != null) { 865 if (st != null) {
864 serializeDeclaredIdentifier( 866 serializeDeclaredIdentifier(
865 node, null, null, false, false, null, false, st); 867 node, null, null, false, false, null, false, st);
866 } 868 }
867 super.visitCatchClause(node); 869 super.visitCatchClause(node);
868 } 870 }
869 871
870 @override 872 @override
871 void visitClassDeclaration(ClassDeclaration node) { 873 void visitClassDeclaration(ClassDeclaration node) {
872 TypeName superclass = 874 TypeName superclass =
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1026 loopVariable.isFinal, 1028 loopVariable.isFinal,
1027 loopVariable.isConst, 1029 loopVariable.isConst,
1028 loopVariable.type, 1030 loopVariable.type,
1029 true, 1031 true,
1030 loopVariable.identifier); 1032 loopVariable.identifier);
1031 super.visitForEachStatement(node); 1033 super.visitForEachStatement(node);
1032 } 1034 }
1033 1035
1034 @override 1036 @override
1035 void visitForStatement(ForStatement node) { 1037 void visitForStatement(ForStatement node) {
1036 serializeVariables(node, node.variables, false, null, null, false); 1038 VariableDeclarationList declaredVariables = node.variables;
1039 if (declaredVariables != null) {
1040 serializeVariables(node, declaredVariables, false, null, null, false);
1041 }
1037 super.visitForStatement(node); 1042 super.visitForStatement(node);
1038 } 1043 }
1039 1044
1040 @override 1045 @override
1041 void visitFunctionDeclaration(FunctionDeclaration node) { 1046 void visitFunctionDeclaration(FunctionDeclaration node) {
1042 executables.add(serializeExecutable( 1047 executables.add(serializeExecutable(
1043 node, 1048 node,
1044 node.name.name, 1049 node.name.name,
1045 node.name.offset, 1050 node.name.offset,
1046 node.isGetter, 1051 node.isGetter,
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 /** 1235 /**
1231 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s. 1236 * A [_TypeParameterScope] is a [_Scope] which defines [_ScopedTypeParameter]s.
1232 */ 1237 */
1233 class _TypeParameterScope extends _Scope { 1238 class _TypeParameterScope extends _Scope {
1234 /** 1239 /**
1235 * Get the number of [_ScopedTypeParameter]s defined in this 1240 * Get the number of [_ScopedTypeParameter]s defined in this
1236 * [_TypeParameterScope]. 1241 * [_TypeParameterScope].
1237 */ 1242 */
1238 int get length => _definedNames.length; 1243 int get length => _definedNames.length;
1239 } 1244 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/in_summary_source_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698