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

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

Issue 2514353005: Add support for "??" to summaries. (Closed)
Patch Set: Created 4 years 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 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 break; 489 break;
490 case UnlinkedExprOperation.pushParameter: 490 case UnlinkedExprOperation.pushParameter:
491 String name = uc.strings[stringPtr++]; 491 String name = uc.strings[stringPtr++];
492 SimpleIdentifier identifier = AstFactory.identifier3(name); 492 SimpleIdentifier identifier = AstFactory.identifier3(name);
493 identifier.staticElement = _enclosingConstructor.parameters 493 identifier.staticElement = _enclosingConstructor.parameters
494 .firstWhere((parameter) => parameter.name == name, 494 .firstWhere((parameter) => parameter.name == name,
495 orElse: () => throw new StateError( 495 orElse: () => throw new StateError(
496 'Unable to resolve constructor parameter: $name')); 496 'Unable to resolve constructor parameter: $name'));
497 _push(identifier); 497 _push(identifier);
498 break; 498 break;
499 case UnlinkedExprOperation.ifNull:
500 _pushBinary(TokenType.QUESTION_QUESTION);
501 break;
499 case UnlinkedExprOperation.assignToRef: 502 case UnlinkedExprOperation.assignToRef:
500 case UnlinkedExprOperation.assignToProperty: 503 case UnlinkedExprOperation.assignToProperty:
501 case UnlinkedExprOperation.assignToIndex: 504 case UnlinkedExprOperation.assignToIndex:
502 case UnlinkedExprOperation.extractIndex: 505 case UnlinkedExprOperation.extractIndex:
503 case UnlinkedExprOperation.invokeMethod: 506 case UnlinkedExprOperation.invokeMethod:
504 case UnlinkedExprOperation.cascadeSectionBegin: 507 case UnlinkedExprOperation.cascadeSectionBegin:
505 case UnlinkedExprOperation.cascadeSectionEnd: 508 case UnlinkedExprOperation.cascadeSectionEnd:
506 case UnlinkedExprOperation.typeCast: 509 case UnlinkedExprOperation.typeCast:
507 case UnlinkedExprOperation.typeCheck: 510 case UnlinkedExprOperation.typeCheck:
508 case UnlinkedExprOperation.throwException: 511 case UnlinkedExprOperation.throwException:
(...skipping 1368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 static String _getElementIdentifier(String name, ReferenceKind kind) { 1880 static String _getElementIdentifier(String name, ReferenceKind kind) {
1878 if (kind == ReferenceKind.topLevelPropertyAccessor || 1881 if (kind == ReferenceKind.topLevelPropertyAccessor ||
1879 kind == ReferenceKind.propertyAccessor) { 1882 kind == ReferenceKind.propertyAccessor) {
1880 if (!name.endsWith('=')) { 1883 if (!name.endsWith('=')) {
1881 return name + '?'; 1884 return name + '?';
1882 } 1885 }
1883 } 1886 }
1884 return name; 1887 return name;
1885 } 1888 }
1886 } 1889 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698