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

Unified 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, 9 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/summary/summarize_ast.dart
diff --git a/pkg/analyzer/lib/src/summary/summarize_ast.dart b/pkg/analyzer/lib/src/summary/summarize_ast.dart
index e685e3965455fffdf565fd13a7909c4fe0cef7d8..b268f3d1dc9262fcf18018a1b8fb64e30c65c462 100644
--- a/pkg/analyzer/lib/src/summary/summarize_ast.dart
+++ b/pkg/analyzer/lib/src/summary/summarize_ast.dart
@@ -858,8 +858,10 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
void visitCatchClause(CatchClause node) {
SimpleIdentifier exception = node.exceptionParameter;
SimpleIdentifier st = node.stackTraceParameter;
- serializeDeclaredIdentifier(
- node, null, null, false, false, node.exceptionType, false, exception);
+ if (exception != null) {
+ serializeDeclaredIdentifier(
+ node, null, null, false, false, node.exceptionType, false, exception);
+ }
if (st != null) {
serializeDeclaredIdentifier(
node, null, null, false, false, null, false, st);
@@ -1033,7 +1035,10 @@ class _SummarizeAstVisitor extends RecursiveAstVisitor {
@override
void visitForStatement(ForStatement node) {
- serializeVariables(node, node.variables, false, null, null, false);
+ VariableDeclarationList declaredVariables = node.variables;
+ if (declaredVariables != null) {
+ serializeVariables(node, declaredVariables, false, null, null, false);
+ }
super.visitForStatement(node);
}
« 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