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

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

Issue 2013093002: Summarize references to closure parameters properly. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 summary_resynthesizer; 5 library summary_resynthesizer;
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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 break; 461 break;
462 case UnlinkedConstOperation.pushReference: 462 case UnlinkedConstOperation.pushReference:
463 _pushReference(); 463 _pushReference();
464 break; 464 break;
465 case UnlinkedConstOperation.extractProperty: 465 case UnlinkedConstOperation.extractProperty:
466 _pushExtractProperty(); 466 _pushExtractProperty();
467 break; 467 break;
468 case UnlinkedConstOperation.invokeConstructor: 468 case UnlinkedConstOperation.invokeConstructor:
469 _pushInstanceCreation(); 469 _pushInstanceCreation();
470 break; 470 break;
471 case UnlinkedConstOperation.pushConstructorParameter: 471 case UnlinkedConstOperation.pushParameter:
472 String name = uc.strings[stringPtr++]; 472 String name = uc.strings[stringPtr++];
473 SimpleIdentifier identifier = AstFactory.identifier3(name); 473 SimpleIdentifier identifier = AstFactory.identifier3(name);
474 identifier.staticElement = resynthesizer.currentConstructor.parameters 474 identifier.staticElement = resynthesizer.currentConstructor.parameters
475 .firstWhere((parameter) => parameter.name == name, 475 .firstWhere((parameter) => parameter.name == name,
476 orElse: () => throw new StateError( 476 orElse: () => throw new StateError(
477 'Unable to resolve constructor parameter: $name')); 477 'Unable to resolve constructor parameter: $name'));
478 _push(identifier); 478 _push(identifier);
479 break; 479 break;
480 case UnlinkedConstOperation.assignToRef: 480 case UnlinkedConstOperation.assignToRef:
481 case UnlinkedConstOperation.assignToProperty: 481 case UnlinkedConstOperation.assignToProperty:
(...skipping 2444 matching lines...) Expand 10 before | Expand all | Expand 10 after
2926 static String _getElementIdentifier(String name, ReferenceKind kind) { 2926 static String _getElementIdentifier(String name, ReferenceKind kind) {
2927 if (kind == ReferenceKind.topLevelPropertyAccessor || 2927 if (kind == ReferenceKind.topLevelPropertyAccessor ||
2928 kind == ReferenceKind.propertyAccessor) { 2928 kind == ReferenceKind.propertyAccessor) {
2929 if (!name.endsWith('=')) { 2929 if (!name.endsWith('=')) {
2930 return name + '?'; 2930 return name + '?';
2931 } 2931 }
2932 } 2932 }
2933 return name; 2933 return name;
2934 } 2934 }
2935 } 2935 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698