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

Side by Side Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 1709663002: Check _localVariableInfo initialized in VariableResolverVisitor. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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 | no next file » | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer.src.generated.resolver; 5 library analyzer.src.generated.resolver;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 12468 matching lines...) Expand 10 before | Expand all | Expand 10 after
12479 * first be visited. If `null` or unspecified, a new [LibraryScope] will be 12479 * first be visited. If `null` or unspecified, a new [LibraryScope] will be
12480 * created based on [definingLibrary] and [typeProvider]. 12480 * created based on [definingLibrary] and [typeProvider].
12481 */ 12481 */
12482 VariableResolverVisitor(LibraryElement definingLibrary, Source source, 12482 VariableResolverVisitor(LibraryElement definingLibrary, Source source,
12483 TypeProvider typeProvider, AnalysisErrorListener errorListener, 12483 TypeProvider typeProvider, AnalysisErrorListener errorListener,
12484 {Scope nameScope}) 12484 {Scope nameScope})
12485 : super(definingLibrary, source, typeProvider, errorListener, 12485 : super(definingLibrary, source, typeProvider, errorListener,
12486 nameScope: nameScope); 12486 nameScope: nameScope);
12487 12487
12488 @override 12488 @override
12489 Object visitBlockFunctionBody(BlockFunctionBody node) {
12490 assert(_localVariableInfo != null);
12491 return super.visitBlockFunctionBody(node);
12492 }
12493
12494 @override
12489 Object visitConstructorDeclaration(ConstructorDeclaration node) { 12495 Object visitConstructorDeclaration(ConstructorDeclaration node) {
12490 ExecutableElement outerFunction = _enclosingFunction; 12496 ExecutableElement outerFunction = _enclosingFunction;
12491 LocalVariableInfo outerLocalVariableInfo = _localVariableInfo; 12497 LocalVariableInfo outerLocalVariableInfo = _localVariableInfo;
12492 try { 12498 try {
12493 _localVariableInfo ??= new LocalVariableInfo(); 12499 _localVariableInfo ??= new LocalVariableInfo();
12494 (node.body as FunctionBodyImpl).localVariableInfo = _localVariableInfo; 12500 (node.body as FunctionBodyImpl).localVariableInfo = _localVariableInfo;
12495 _enclosingFunction = node.element; 12501 _enclosingFunction = node.element;
12496 return super.visitConstructorDeclaration(node); 12502 return super.visitConstructorDeclaration(node);
12497 } finally { 12503 } finally {
12498 _localVariableInfo = outerLocalVariableInfo; 12504 _localVariableInfo = outerLocalVariableInfo;
12499 _enclosingFunction = outerFunction; 12505 _enclosingFunction = outerFunction;
12500 } 12506 }
12501 } 12507 }
12502 12508
12503 @override 12509 @override
12504 Object visitExportDirective(ExportDirective node) => null; 12510 Object visitExportDirective(ExportDirective node) => null;
12505 12511
12506 @override 12512 @override
12513 Object visitExpressionFunctionBody(ExpressionFunctionBody node) {
12514 assert(_localVariableInfo != null);
12515 return super.visitExpressionFunctionBody(node);
12516 }
12517
12518 @override
12507 Object visitFunctionDeclaration(FunctionDeclaration node) { 12519 Object visitFunctionDeclaration(FunctionDeclaration node) {
12508 ExecutableElement outerFunction = _enclosingFunction; 12520 ExecutableElement outerFunction = _enclosingFunction;
12509 LocalVariableInfo outerLocalVariableInfo = _localVariableInfo; 12521 LocalVariableInfo outerLocalVariableInfo = _localVariableInfo;
12510 try { 12522 try {
12511 _localVariableInfo ??= new LocalVariableInfo(); 12523 _localVariableInfo ??= new LocalVariableInfo();
12512 (node.functionExpression.body as FunctionBodyImpl).localVariableInfo = 12524 (node.functionExpression.body as FunctionBodyImpl).localVariableInfo =
12513 _localVariableInfo; 12525 _localVariableInfo;
12514 _enclosingFunction = node.element; 12526 _enclosingFunction = node.element;
12515 return super.visitFunctionDeclaration(node); 12527 return super.visitFunctionDeclaration(node);
12516 } finally { 12528 } finally {
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
12779 nonFields.add(node); 12791 nonFields.add(node);
12780 return null; 12792 return null;
12781 } 12793 }
12782 12794
12783 @override 12795 @override
12784 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this); 12796 Object visitNode(AstNode node) => node.accept(TypeResolverVisitor_this);
12785 12797
12786 @override 12798 @override
12787 Object visitWithClause(WithClause node) => null; 12799 Object visitWithClause(WithClause node) => null;
12788 } 12800 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698