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

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

Issue 1560433002: Test for changing method to/from getter/setter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 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) 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.incremental_resolver; 5 library analyzer.src.generated.incremental_resolver;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' as math; 8 import 'dart:math' as math;
9 9
10 import 'package:analyzer/dart/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 _removedElements.remove(element); 350 _removedElements.remove(element);
351 // matches, update the existing element 351 // matches, update the existing element
352 node.name.staticElement = element; 352 node.name.staticElement = element;
353 _setLocalElements(element, newElement); 353 _setLocalElements(element, newElement);
354 } on _DeclarationMismatchException { 354 } on _DeclarationMismatchException {
355 _removeElement(element); 355 _removeElement(element);
356 // add new element 356 // add new element
357 if (newElement != null) { 357 if (newElement != null) {
358 _addedElements.add(newElement); 358 _addedElements.add(newElement);
359 if (newElement is MethodElement) { 359 if (newElement is MethodElement) {
360 List<MethodElement> methods = _enclosingClass.methods; 360 List<MethodElement> methods = _enclosingClass.methods.toList();
361 methods.add(newElement); 361 methods.add(newElement);
362 _enclosingClass.methods = methods; 362 _enclosingClass.methods = methods;
363 } else { 363 } else {
364 List<PropertyAccessorElement> accessors = _enclosingClass.accessors; 364 List<PropertyAccessorElement> accessors =
365 _enclosingClass.accessors.toList();
365 accessors.add(newElement); 366 accessors.add(newElement);
366 _enclosingClass.accessors = accessors; 367 _enclosingClass.accessors = accessors;
367 } 368 }
368 } 369 }
369 } 370 }
370 } 371 }
371 372
372 @override 373 @override
373 visitPartDirective(PartDirective node) { 374 visitPartDirective(PartDirective node) {
374 String uri = _getStringValue(node.uri); 375 String uri = _getStringValue(node.uri);
(...skipping 1721 matching lines...) Expand 10 before | Expand all | Expand 10 after
2096 @override 2097 @override
2097 String toString() => name; 2098 String toString() => name;
2098 } 2099 }
2099 2100
2100 class _TokenPair { 2101 class _TokenPair {
2101 final _TokenDifferenceKind kind; 2102 final _TokenDifferenceKind kind;
2102 final Token oldToken; 2103 final Token oldToken;
2103 final Token newToken; 2104 final Token newToken;
2104 _TokenPair(this.kind, this.oldToken, this.newToken); 2105 _TokenPair(this.kind, this.oldToken, this.newToken);
2105 } 2106 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698